Created
August 5, 2014 09:36
-
-
Save DaveWoodCom/ce3a3a6467a7fc7a71a3 to your computer and use it in GitHub Desktop.
if optional != nil is fugly!
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
public extension Optional { | |
public var exists: Bool { | |
return (self != nil) | |
} | |
public var notExists: Bool { | |
return (self == nil) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment