download image with Alamofire

1808 단어 iOS
 Alamofire.request(.GET, profile_picture_url!).response { (request, response, data , error) in

                        if error != nil {
                            NSLog("Error downloading thumbnail image: \(error)")
                        } else {
                            if let downloadedImage = UIImage(data: data!) {

                                dispatch_async(dispatch_get_main_queue()) {
                                    self.topImageView.image = downloadedImage

                                }//dispatch_async(dispatch_get_main_queue())

                            }//if let downloadedImage = UIImage(data: data!)
                        }//else No error
                    }//Alamofire.request

좋은 웹페이지 즐겨찾기