Skip to content

Instantly share code, notes, and snippets.

@PavelGnatyuk
Last active July 11, 2018 06:14
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 PavelGnatyuk/36127f69e6f9f35a52aa280850c0a020 to your computer and use it in GitHub Desktop.
Save PavelGnatyuk/36127f69e6f9f35a52aa280850c0a020 to your computer and use it in GitHub Desktop.
autoclosure sample code 1
func goodMorning(morning: Bool, whom: String) {
if morning {
print("Good morning, \(whom)")
}
}
goodMorning(morning: true, whom: "Pavel")
goodMorning(morning: false, whom: "John")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment