/SwiftNotesAndSnippets

Notes and Snippets about Swift

Primary LanguageSwiftGNU General Public License v2.0GPL-2.0

SwiftNotesAndSnippets

Closures as function Parameters

If I want to do a Swift closure in a function declaration:

func theFunction(aParam: String, aCallback: ((String, Int) -> Void)) {
  aCallback("Some String", 147)
}