UIDocumentInteractionController is a powerful class available to iPhone developers that let developers to provide in app support to their users. For example a wallpaper application, that allows user’s to save wallpaper images in their photos app of the device.
For this purpose developer has two options
1). Save image to photo gallery programmatically
2). Present UIDocumentInteractionController to user which has inbuilt option to save image or send image to other apps that are capable of opening that particular document (in our case its an image).
In this article we are going to learn about UIDocumentInteractionController and its integration in iOS.
First create an instance of UIDocumentInteractionController , we will use interactionControllerWithURL method which require url of the file we are going to save or you can say want to send to other apps. Then we will set its delegate to self.
In your .h file create a property of UIDocumentInteractionController instance.
in your .m file. in viewDidLoad or your button IBAction