Posts

Post not yet marked as solved
107 Views

How to save UIImage array and then use it?

I already have an array: var imgArr = [UIImage]() I want to add there elements: imgArr.append(UIImage) Save it, for example: imgArr.save() // example And then get items from it, to add array elements to cells: func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {         let cell = tableView.dequeueReusableCell(withIdentifier: "MyCell", for: indexPath) 	 cell.imageView!.image = imgArr[indexPath.row]         return cell     }
Asked
by nickXone.
Last updated
.
Post marked as solved
218 Views

How to save array of UIImages?

I have array: var imgs: [UIImage] = userDefaults.object(forKey: "myKey") as? [UIImage] ?? [] How I can save it?
Asked
by nickXone.
Last updated
.
Post not yet marked as solved
192 Views

How I can save scans to user's photo library?

extension ViewController: VNDocumentCameraViewControllerDelegate, UIImagePickerControllerDelegate {     func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinish scan: VNDocumentCameraScan) {         for pageNumber in 0..<scan.pageCount {             let image = scan.imageOfPage(at: pageNumber)             print(image)             //save             hasPhoto = true             UIImageWriteToSavedPhotosAlbum(image, self, #selector(image(_:didFinishSavingWithError:contextInfo:)), nil)             //UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)         }         controller.dismiss(animated: true, completion: nil)     }
Asked
by nickXone.
Last updated
.
Post marked as solved
143 Views

How I can save UIImage to custom album?

I already have custom album: let title = "NewScans"         PHPhotoLibrary.shared().performChanges({             PHAssetCollectionChangeRequest.creationRequestForAssetCollection(withTitle: title)         }, completionHandler: { success, error in             if !success { print("Error creating album: \(String(describing: error)).") }         }) And I would like to save in it UIImage, how I can do this?
Asked
by nickXone.
Last updated
.