I already have an array:
I want to add there elements:
Save it, for example:
And then get items from it, to add array elements to cells:
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 }