Save My app image to gallery iOS swift || Save Document directory image into Gallery iOS swift

Solution:

In below function MyImage is an image that i want to save it into my gallery.

    UIImageWriteToSavedPhotosAlbum(MyImage, self, #selector(image(_:didFinishSavingWithError:contextInfo:)), nil)


  //MARK: - Add image to Library

  @objc func image(_ image: UIImage, didFinishSavingWithError error: Error?, contextInfo: UnsafeRawPointer) {

    

  }

Comments

Popular posts from this blog

store cgpoint in userdefaults iOS swift

libc++abi: terminating due to uncaught exception of type NSException iOS swift