Skip to content

Instantly share code, notes, and snippets.

@csainty
Created June 2, 2014 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csainty/31f2dbea5ae152b695d6 to your computer and use it in GitHub Desktop.
Save csainty/31f2dbea5ae152b695d6 to your computer and use it in GitHub Desktop.
Swift Optionals
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