PHPhotoLibrary.shared().performChanges({ () -> Void in
let request = PHAssetCreationRequest.forAsset()
request.addResource(with: .pairedVideo, fileURL: videoURL, options: nil)
request.addResource(with: .photo, fileURL: imageURL, options: nil)}, completionHandler: { (result : Bool, error : Error?) -> Void in
if result {
NSLog("save to camera roll as live photo")
} else {
if error != nil {
print("something wrong when saving : %@", error!)
}
}
})
但是,Error Domain=NSCocoaErrorDomain Code=-1 "(null)"。如何解决?