Advertisement
Guest User

Untitled

a guest
May 5th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //: Playground - noun: a place where people can play
  2.  
  3. import UIKit
  4. import XCPlayground // we import this so we can get the main XCPlayground "page"
  5.  
  6. //create instance of current playground page
  7. let page = XCPlayground.XCPlaygroundPage
  8.  
  9. func myCoolFunctionWithCompletion(input: String, completion: (result: String) -> Void) {
  10. print("\(input) ... ")
  11. completion(result: "we finished!")
  12. }
  13.  
  14. myCoolFunctionWithCompletion("start") {
  15. (result: String) in
  16. print("got back: \(result)")
  17. page.currentPage.finishExecution() // finish execution on main page
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement