如何将具有特定日期的视频保存到相机胶卷中?

时间:2019-07-10 12:16:30

标签: swift phphotolibrary

我将视频保存到相机胶卷的末尾

PHPhotoLibrary.shared().performChanges({
    PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: mergedVideoFile!)
}) { saved, error in
     if saved {
         print("saved")
     }
}

1 个答案:

答案 0 :(得分:0)

这很容易,您需要在戴Date的同时传递PHAsset

PHPhotoLibrary.shared().performChanges({
    let changeRequest = PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: videoUrl)
    changeRequest.creationDate = Date() //Pass whichever Date you want
}) { (success, error) in
    debugPrint(success)
    debugPrint(error)
}