I am developing an app that works as a rss reader, when reading the information of an xml, I get the title of the news, the date, and an image, I get the image with the following code:
var cell:UITableViewCell = UITableViewCell()
cell = tableView.dequeueReusableCellWithIdentifier("BasicCell")!
let imageView: UIImageView? = cell.viewWithTag(2) as! UIImageView?
let url:NSURL? = NSURL(string:currentArticleToDisplay.imagen)
let imageRequest = NSURLRequest(URL: url!)
NSURLConnection.sendAsynchronousRequest(imageRequest, queue: NSOperationQueue.mainQueue(), completionHandler: {(response, data, error) in
actualImageView.image = UIImage(data: data!)
})
I have added a constraint so that the image occupies the width of the screen, but how can I get the image with the full width, but without cutting the image, since as I have it now, I get the image but cut to the size of the screen. Thanks