PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: videoURL as URL)
        }) { success, error in
            if !success {
                print("Error saving video: \(String(describing: error))")

Results in: Error saving video: Optional(Error Domain=PHPhotosErrorDomain Code=-1 "(null)")

I found this similar problem solution on github for images and I think objC(?):

the code below will cause error on iOS 13 devices when import uri is https://xxxxx.png assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImageAtFileURL:inputURI];

this way works well NSData *data = [NSData dataWithContentsOfURL:inputURI]; UIImage *image = [UIImage imageWithData:data]; assetRequest = [PHAssetChangeRequest creationRequestForAssetFromImage:image];


So I am thinking I might need to find a wrapper class for video? I'm finding if very difficult to find good resources for working with swift.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.