Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //: Playground - noun: a place where people can play
- import UIKit
- import XCPlayground // we import this so we can get the main XCPlayground "page"
- //create instance of current playground page
- let page = XCPlayground.XCPlaygroundPage
- func myCoolFunctionWithCompletion(input: String, completion: (result: String) -> Void) {
- print("\(input) ... ")
- completion(result: "we finished!")
- }
- myCoolFunctionWithCompletion("start") {
- (result: String) in
- print("got back: \(result)")
- page.currentPage.finishExecution() // finish execution on main page
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement