swift function with completion handler code example
Example: swift completion handler
func thisNeedsToFinishBeforeWeCanDoTheNextStep(completion: (String) -> ()) {
let stringToPassOutOfTheCompletionHandler = "The quick brown fox"
completion(stringToPassOutOfTheCompletionHandler)
}