Created
June 2, 2014 20:04
-
-
Save csainty/31f2dbea5ae152b695d6 to your computer and use it in GitHub Desktop.
Swift Optionals
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
class Foo { | |
func bar() -> String { | |
return "Hello" | |
} | |
} | |
func greet (f: Foo) -> String { | |
return f.bar() | |
} | |
var f :Foo? = nil | |
greet(f) // Error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment