Reputation: 11
How to share an image from my app to other app?
I have a button in my UIViewController
and when it is clicked it should show other app available for sharing
Upvotes: 0
Views: 860
Reputation: 757
Try this code
let activityItem: [AnyObject] = [self.imageView.image as! AnyObject]
let avc = UIActivityViewController(activityItems: activityItem as [AnyObject], applicationActivities: nil)
self.presentViewController(avc, animated: true, completion: nil)
Upvotes: 2