Questions tagged [uiactivityviewcontroller]

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application (on iOS).

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application. The system provides several standard services, such as copying items to the pasteboard, posting content to social media sites, sending items via email or SMS, and more. Apps can also define custom services.

Resources:

1252 questions
15
votes
3 answers

UIActivityViewController: How to get if the activity is completed or not

I am using UIActivityViewController in that i added facebook, twitter and mail. After i complete share activity using any one of these feature how can i get the success callback. Any ideas are appreciated,
Maniganda saravanan
  • 2,188
  • 1
  • 19
  • 35
15
votes
3 answers

How can I add a ActivityItem to upper activity bar in UIActivityViewController?

I like to add my own WhatsApp ActivityItem to the UIActivityViewController, but it is always added to the lower non colored activity bar, but I like to add it to the upper bar, the one with the colored items. Thats the code I use: WhatsApp…
David Gölzhäuser
  • 3,525
  • 8
  • 50
  • 98
14
votes
4 answers

sharing video using uiactivityViewcontroller

I am developing an application and want to share images videos and other files saved into my document directory using uiactivityviewcontroller. images and files sharing is working properly. Code for image sharing var textToShare : Any! textToShare…
Aqeel Ahmad
  • 709
  • 7
  • 20
14
votes
4 answers

Swift UIActivityViewController Image&Url Share not working with FB

I am using UIActivityViewController to share image. After the Facebook recent changes . I am able share an image and Url individualy but i am unable to share both image and url at a time. The same code works fine with Mail, twitter etc., Not sure…
13
votes
2 answers

UIActivityViewController vs UIDocumentInteractionController in ios

I just read some articles on UIActivityViewController and UIDocumentInteractionController in iOS, but I am very confused about how to use them because both seem the same. So, when do I use UIActivityViewController or…
12
votes
2 answers

how to create user interactive tweet or Facebook post with UIActivityViewController

I am trying to figure out how to create a user interactive post or tweet kind of like SoundCloud's here below: The portion highlighted in yellow is the part that interests me because as far as I can tell when it comes to UIActivityViewController…
Garret Kaye
  • 2,412
  • 4
  • 21
  • 45
12
votes
5 answers

UIActivityViewController crashing on iPad with sourceView or barButtonItem

I have come across what looks like a situation that most people face when trying to present a UIActivityViewController on the iPad; it is crashing with: Terminating app due to uncaught exception 'NSGenericException', reason:…
amitsbajaj
  • 1,304
  • 1
  • 24
  • 59
12
votes
2 answers

Can't share to linkedin using UIActivityViewController

I can't share anything via linkedin using UIActivityViewController. While I tap share via linkedin, it opens the sharing pop up and dismisses immediately after opened it. All other sharing are working fine. Could you please tell me a solution?…
Mumthezir VP
  • 6,251
  • 6
  • 28
  • 57
12
votes
2 answers

Sharing image to Whatsapp & Facebook

I'm already able to share photos to Whatsapp but the way I do this is by providing Whatsapp option in a UIActivityViewController and then showing a UIDocumentInteractionController. From this UIDocumentInteractionController, I choose the Whatsapp…
12
votes
2 answers

Control file name of UIImage send with UIActivityViewController

I'm sharing an image, along with a url and some text, with a UIActivityViewController. Everything works great, except the image file name is always 'Image-1' with no extension. In some cases this causes a big problem, such as in the mail app which…
Anthony Mattox
  • 7,048
  • 6
  • 43
  • 59
12
votes
3 answers

creating and using a .csv file with UIActivityViewController

So I am creating a .csv file and then allowing the user to share it using the UIActivityViewController. My code to create the csv file will return the NSURL of the file: - (NSURL *)exportToCSV { NSString *docPath =…
Alex
  • 1,042
  • 3
  • 13
  • 32
12
votes
2 answers

Compose UIActivityTypeMessage with UIImage

Was wandering if anyone can offer some insight. For the life of me I can't figure out how to send a UIImage with UIActivityTypeMessage all though some say it is possible. The docs…
11
votes
0 answers

UIActivityViewController excludedActivityTypes not working with custom UIActivityTypes

I'm having trouble excluding custom UIActivityTypes from UIActivityViewController I have… extension UIActivityType { static let fbMessenger = UIActivityType("com.facebook.Messenger.ShareExtension") static let telegram =…
Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
11
votes
1 answer

Share App application shortcut [UIApplicationShortcutIconTypeShare]

I've seen a lot of apps use the UIApplicationShortcutIconTypeShare application shortcut to share their app right from the home screen. It launches a UIActivityViewController right from the home screen without opening the app. How do you do that?
11
votes
1 answer

UIActivityViewController.completionWithItemsHandler is not called on iOS 10.0 when I select "Print" menu and cancel it

I created a simple application which uses UIActivityViewController as below. let text = "Test Text" let printData = UISimpleTextPrintFormatter(text: text) let vc = UIActivityViewController(activityItems: [text, printData],…
kunichiko
  • 113
  • 1
  • 7