Answer the question
In order to leave comments, you need to log in
How to unzip NSKeyed images from CoreData in CollectionView swift 3?
Hello!
There is a function with which I saved all downloaded images:
for img in imgArray{
let data : NSData = NSData(data: UIImagePNGRepresentation(img))
CDataArray.addObject(data);
}
//convert the Array to NSData
//you can save this in core data
var coreDataObject = NSKeyedArchiver.archivedDataWithRootObject(CDataArray)
Answer the question
In order to leave comments, you need to log in
let images = NSKeyedUnarchiver.unarchiveObject(with: recipe.imageRecipe! as Data) as! NSMutableArray
let img = UIImage(data: images[indexPath.row] as! Data)!
cell.recipeImageView.image = img
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question