[swift-dev] imageView does't show the image with Swift 3 and Xcode 8
cuiyue at msu.edu
Wed Oct 19 15:44:02 CDT 2016
I recently migrated my app to Swift 3 and Xcode 8.
The imageView didn't show the image if I re-open the app.
I used viewWillAppear() for this function. The code is as below:
let imageUrl: NSURL = NSURL(string: "\(userDefaults.string(forKey:
let imageData:NSData = NSData(contentsOf: imageUrl as URL)!
let logo = UIImage(data: imageData as Data)!
self.logoImage.image = logo
Thanks in advance.
More information about the swift-dev