Created
November 26, 2018 16:34
-
-
Save Hadevs/e983430f2f7ea24cf6e944fac2949d64 to your computer and use it in GitHub Desktop.
This file contains 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 | |
extension Optional where Wrapped == Bool { | |
static prefix func !(value: Bool?) -> Bool? { | |
return value.flatMap { !$0 } | |
} | |
} | |
var isOn: Bool? = nil | |
isOn = true | |
print(!isOn) // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment