Punit Naik
Punit Naik

Reputation: 11

sharing Image from App to other app in ios

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

  1. how can I show a pop up showing all the apps available?
  2. how can I share it with flicker app?

Upvotes: 0

Views: 860

Answers (1)

Chandan
Chandan

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

Related Questions