I\'m trying to save a UIImage to NSData and then read the NSData back to a new UIImage in Swift. To convert the UII
UIImage
NSData
UII
Now in Swift 4.2 you can use pngData() new instance method of UIImage to get the data from the image
pngData()
let profileImage = UIImage(named:"profile")! let imageData = profileImage.pngData()