Skip to content

Instantly share code, notes, and snippets.

@nuclearace
Created February 23, 2016 14:39
Show Gist options
  • Select an option

  • Save nuclearace/9774f1ccd770b6d24ad8 to your computer and use it in GitHub Desktop.

Select an option

Save nuclearace/9774f1ccd770b6d24ad8 to your computer and use it in GitHub Desktop.
struct Bob {
let lastName: String
static var creth: Bob {
return Bob(lastName: "Creth")
}
static func bobNamedFlumper() -> Bob {
return Bob(lastName: "Flumper")
}
}
func someFuncThatTakesABob(bob: Bob) -> String {
return "Bob \(bob.lastName)"
}
print(someFuncThatTakesABob(.bobNamedFlumper()))
print(someFuncThatTakesABob(.creth))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment