Hello!
After updating my device to iOS 14.0.1 my application started to receive an error - Error Domain=PHPhotosErrorDomain Code=-1 - after downloading video from remote url.
It was fine on iOS 13.
This is my code
After updating my device to iOS 14.0.1 my application started to receive an error - Error Domain=PHPhotosErrorDomain Code=-1 - after downloading video from remote url.
It was fine on iOS 13.
This is my code
Code Block func didFinishedDownloading(to location: URL) { let exists = FileManager.default.fileExists(atPath: location.path) debugPrint("EXISTS", exists) var attemptsToSave: Int = 0 func saveToCameraRoll() { PHPhotoLibrary.shared().performChanges({ PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: location) }) { saved, error in guard error == nil, attemptsToSave < 3 else { debugPrint("ERROR ON SAVING", error, error?.localizedDescription, attemptsToSave) if attemptsToSave < 3 { DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { attemptsToSave+=1 saveToCameraRoll() } } else { DispatchQueue.main.async { [weak self] in self?.currentState = .error(.download) } } return } DispatchQueue.main.async { [weak self] in if saved { debugPrint("TIME INTERVAL", self?.completionTimer?.timeInterval) } } } } saveToCameraRoll() }