Swift: save video from NSURL to user camera roll

前端 未结 6 625
天命终不由人
天命终不由人 2020-12-13 13:40

I have a variable videoURL of type NSURL.

If I call println(videoURL) it would return something like this: http://files.parsetfss.com

6条回答
  •  爱一瞬间的悲伤
    2020-12-13 14:17

    deprecated as of iOS 9

    1: import AssetsLibrary

    import AssetsLibrary
    

    2: Use this code to save video from url to camera library.

    ALAssetsLibrary().writeVideoAtPathToSavedPhotosAlbum(outputFileURL, completionBlock: nil)
    

提交回复
热议问题