try await PHPhotoLibrary.shared().performChanges {
let creationRequest = PHAssetCreationRequest.forAsset()
creationRequest.addResource(with: .photo, data: imageData, options: nil)
// Add live photo video if available
if self.isLiveModeEnabled,
let movieURL = photo.livePhotoMovieFileURL {
print("Adding live photo video data")
let options = PHAssetResourceCreationOptions()
options.shouldMoveFile = true
creationRequest.addResource(with: .pairedVideo,
fileURL: movieURL,
options: options)
}
}
}
} catch {
self.error = error
}
}
}
I cant get it right, was trying to add live picture, but it kept saying:
Value of type ‘AVCapturePhoto’ has no member ‘livePhotoMovieFileURL’
Runcong Wu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.