How to save UIImage array and then use it?

I already have an array:
Code Block
var imgArr = [UIImage]()

I want to add there elements:
Code Block
imgArr.append(UIImage)

Save it, for example:
Code Block
imgArr.save() // example

And then get items from it, to add array elements to cells:
Code Block
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "MyCell", for: indexPath)
cell.imageView!.image = imgArr[indexPath.row]
        return cell
    }

And… where is the problem ?
As long as the app is active, imgArr must do the job.
  • So, what's the problem ? getting the images from saved files ?

  • for saving, you had another post. Does it work ?

Please:
  • explain exactly the problem

  • does it crash ? if yes, show the crash log

  • doesn't it do what you expect ? if yes, Explain.

  • in any cases, show your code for saving and reading images

How to save UIImage array and then use it?
 
 
Q