Created
June 10, 2014 10:34
-
-
Save dennda/9cab1de2816080839953 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
func nilAndPrintError<T>(errorMessage: String) -> T? { | |
println(errorMessage) | |
return nil | |
} | |
// usage: | |
func myFunc() -> SomeType? { | |
return nilAndPrintError("myFunc failed, O the embarrassment!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment