0

I created a custom folder to save the image in the gallery through my application(which is achieved code as below). Now I want to set a custom name for that saved image. How can I achieve this challenge? If anyone possible to help me to achieve this challenge.

func save(image: UIImage, strName : String) {

        self.checkAuthorizationWithHandler { (success) in
            if success, self.assetCollection != nil {
                PHPhotoLibrary.shared().performChanges({
                    let assetChangeRequest = PHAssetChangeRequest.creationRequestForAsset(from: image)
                    let assetPlaceHolder = assetChangeRequest.placeholderForCreatedAsset
                    let albumChangeRequest = PHAssetCollectionChangeRequest(for: self.assetCollection)
                    let enumeration: NSArray = [assetPlaceHolder!]
                    albumChangeRequest!.addAssets(enumeration)

                }, completionHandler: nil)
            }
        }
    }
Senthilkumar
  • 2,471
  • 4
  • 30
  • 50

0 Answers0