Swift2 - CallBack 예제
비동기식 데이터에서 콜백함수를 넣어야함. func loadImage(urlString:String, handler:(image:UIImage?)-> Void) { var imgURL: NSURL = NSURL(string: urlString)! let request: NSURLRequest = NSURLRequest(URL: imgURL) NSURLConnection.sendAsynchronousRequest( request, queue: NSOperationQueue.mainQueue(), completionHandler: {(response: NSURLResponse!,data: NSData!,error: NSError!) -> Void in if error == nil { handler(image:..