Created
July 17, 2017 09:05
-
-
Save dimpiax/a7ad78c11804ca30a06b1a856632a070 to your computer and use it in GitHub Desktop.
Revisions
-
dimpiax created this gist
Jul 17, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ extension Optional where Wrapped == Bool { var bool: Bool { switch self { case .some(let value): return value == true case .none: return false } } } var foo: Bool? = true if foo.bool { print("Hello!") }