Booleans in Swift

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 ter…


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Booleans in Swift." flaviocopes.com | Sciencx - Wednesday June 2, 2021, https://www.scien.cx/2021/06/02/booleans-in-swift/
HARVARD
flaviocopes.com | Sciencx Wednesday June 2, 2021 » Booleans in Swift., viewed ,<https://www.scien.cx/2021/06/02/booleans-in-swift/>
VANCOUVER
flaviocopes.com | Sciencx - » Booleans in Swift. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/02/booleans-in-swift/
CHICAGO
" » Booleans in Swift." flaviocopes.com | Sciencx - Accessed . https://www.scien.cx/2021/06/02/booleans-in-swift/
IEEE
" » Booleans in Swift." flaviocopes.com | Sciencx [Online]. Available: https://www.scien.cx/2021/06/02/booleans-in-swift/. [Accessed: ]
rf:citation
» Booleans in Swift | flaviocopes.com | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.