How to make an IOS 8 share extenison that will have deafult text

49 Views Asked by At

In my app there is text displayed in a label on screen.

I have a share button when pressed brings the UIActivityViewController but when you press the share extensions ex: Twitter, you get the compose view with nothing inside of it.

I want it that it puts the text from the label on the screen into the compose view.

1

There are 1 best solutions below

0
Arben Pnishi On
let activityItems = ["The string you want to share!"] // Add this to your code
let activeVC = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)

self.presentViewController(activeVC, animated: true, completion: nil)