I have array:
How I can save it?
Code Block var imgs: [UIImage] = userDefaults.object(forKey: "myKey") as? [UIImage] ?? []
How I can save it?
Where do you want to save ?
To a file ?
Maybe the best is to save each image on an individual file, that will make retrieving, removing… simpler.
In that case:
You can convert images:
To a file ?
Maybe the best is to save each image on an individual file, that will make retrieving, removing… simpler.
In that case:
You can convert images:
Code Block for img in imgs { let imageData = img.pngData() let fileName = // Create a file name for each image ; for instance from the name of the image fileManager.createFile(atPath: fileName, contents: imageData, attributes: nil) }