let url = NSURL(string: "http://www.ietaiji.com/apppic/1.jpg")
let request = NSURLRequest(URL: url!)
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue()) { (_, dataResult, e) -> Void in
print(dataResult)
if e == nil{
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.imgView1.image = UIImage(data: dataResult!)
})
}
}
标签:url,Void,request,网络,dispatch,获得,dataResult,let,图片 From: https://blog.51cto.com/u_512327/5933742