Created
February 18, 2016 14:08
-
-
Save chrene/0ca4a3d228ea794d5377 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 ImplicitlyUnwrappedOptional: BooleanType { | |
/// Gets the boolean value of an implicitly unwrapped optional type | |
/// For all .None or nil values return false. Otherwise return true | |
public var boolValue: Bool { | |
return self != nil | |
} | |
} | |
extension Optional : BooleanType { | |
/// Gets the boolean value of an optional type | |
/// For all .None or nil values return false. Otherwise return true | |
public var boolValue: Bool { | |
return self != nil | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment