Created
October 15, 2020 20:17
-
-
Save foxicode/9b13826ee414079bdf3140aa3fb35056 to your computer and use it in GitHub Desktop.
Swift Bool conversions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| let b1 = Bool("1") // nil | |
| let b0 = Bool("0") // nil | |
| let bYes = Bool("YES") // nil | |
| let bNo = Bool("NO") // nil | |
| let bTrue = Bool("true") // true | |
| let bFalse = Bool("false") // false | |
| print(true) // "true\n" | |
| print(false) // "false\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment