I am trying to save a large video locally to the photo library using PHPhotoLibrary
but i notice that it takes a very long time is there any way to get progress or even better to make the process faster
my code:
func saveToLibrary(videoURL: URL, complition: @escaping () -> Void) {
PHPhotoLibrary.requestAuthorization { status in
guard status == .authorized else { return }
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: videoURL)
}) { success, error in
if !success {
print("Could not save video to photo library: \( error as Any)")
} else {
complition()
}
}
}
}