If you want to load big image from URL so you can use AFNetworking Library into your Project, so with the help of this library you can load big image from url without freezing your app.
First download AFNetworking Library from GitHub by click on this link
https://github.com/AFNetworking/AFNetworking
after download unzip and and add to your project
1. now import AFNetworking.h file into your YourProject-Bridging-Header.h file
and now create object of AFHTTPRequestOperation
Source Code:
let UrlString:NSString = “Your Image URL”
let ImageURL:NSURL = NSURL(string: UrlString:NSString as String)!
let URLRequest:NSURLRequest = NSURLRequest(URL: ImageURL)
let requestOperation:AFHTTPRequestOperation = AFHTTPRequestOperation(request: URLRequest)
requestOperation.responseSerializer = AFHTTPResponseSerializer()
requestOperation.setCompletionBlockWithSuccess({ (operation:AFHTTPRequestOperation, data:AnyObject) -> Void in
yourImageView.image = UIImage(data: data as! NSData)
}, failure: { (operation:AFHTTPRequestOperation?, error:NSError) -> Void in
yourImageView.image = UIImage(named: “default.png”)
})
requestOperation.start()
)
guest test post
I have learn several excellent stuff here. Definitely worth bookmarking for revisiting.
I surprise how so much attempt you put to create such a excellent
informative website.