This content originally appeared on flaviocopes.com and was authored by flaviocopes.com
This tutorial belongs to the Swift series
Swift provides the Bool
type, which can have two values: true
and false
.
var done = false
done = true
Booleans are especially useful with conditional control structures like if
statements or the ternary conditional operator:
var done = true
if done == true {
//code
}
This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

flaviocopes.com | Sciencx (2021-06-02T05:00:00+00:00) Booleans in Swift. Retrieved from https://www.scien.cx/2021/06/02/booleans-in-swift/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.