I want to put a UIImage
array into UserDefaults
and then retrieve it. After that set the retrieved images in an image view. How can I do that?
You can easily save your image in documentDirectory as below:
let documentDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
let fileURL = documentDirectory?.appendingPathComponent(yourImageName)
and then, you can give your image to UserDefaults