How to save video in user album ?

hey,

severals hours for searching a solution without success...

i want to save a URL video into a specific User Album and unfortunatly nothing happen ! if I define only the new name of the video (without the urlpath), I can find the video in the recent album !

anybody have an idea what 's happen ?

please see below example of my code

       let galleryPath = self.getDirectoryPath() print ("######### value of galleryPath  : (String(describing: galleryPath))")

                let filePath = galleryPath + "/nameX.mov"                 print ("######### value of filePath  : (String(describing: filePath))")

              DispatchQueue.main.async {

                urlData.write(toFile: filePath, atomically: true)

                   PHPhotoLibrary.shared().performChanges({

                   PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL:

                   URL(fileURLWithPath: filePath))

                }) {

                   success, error in

                   if success {

                      print("Succesfully Saved")

                   } else {

                      print(error?.localizedDescription)

                   }

                }

             }

Many thanks for your help ! JM

How to save video in user album ?
 
 
Q