【问题标题】:How can i save a video to the camera roll with a specific date?如何将视频保存到具有特定日期的相机胶卷?
【发布时间】:2019-07-10 12:16:30
【问题描述】:

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

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

【问题讨论】:

    标签: swift phphotolibrary


    【解决方案1】:

    这很简单,你需要通过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)
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-12
      • 2016-05-01
      • 2015-01-06
      • 1970-01-01
      • 2014-02-02
      • 1970-01-01
      • 2012-05-30
      • 1970-01-01
      相关资源
      最近更新 更多