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
9
votes
5 answers

Figuring out which icon was clicked on in UIActivityViewController

Using the "Social" Framework, when presenting the modal UIActivityViewController that displays all the usual social-media icons, is there a way to find out exactly which icon the user clicked on? Meaning, if they chose Twitter, Facebook, Mail,…
sirab333
  • 3,662
  • 8
  • 41
  • 54
9
votes
2 answers

UIActivityViewController - Only attach a URL for certain activities

I've been trying to use the new UIActivityViewController to replace all of my UIActionSheets for sharing, however I've run into an issue. I have 5 activities, Message, Email, Copy, Twitter, and Facebook. I've already figured out how to have those…
mhbdr
  • 753
  • 2
  • 10
  • 26
9
votes
1 answer

iOS UIActivity View Controller: Add To Reading List Button?

Is there a service to be able to add a URL to the iOS Safari's Reading List from in a app. I would have a url to add and a UIWebView,but I have researched and I can't find anything. Here is my working UIActivityViewController. …
Steve
  • 205
  • 3
  • 14
8
votes
1 answer

The application is not permitted to access iTunes Store accounts with UIActivityViewController

I am trying to share my app URL with UIActivityViewController and here is my code: let items = [URL(string: "https://itunes.apple.com/de/app/idxxxxxxxxx")!] let ac = UIActivityViewController(activityItems: items, applicationActivities:…
Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
8
votes
1 answer

iOS 13 Share Sheet: Changing subtitle/item description

The new iOS 13 share sheet provides a nice header that shows the context of the item being shared. I haven't been able to figure out how to change the item description though. I've used activityViewControllerLinkMetadata function which partially…
Jagoan Neon
  • 1,072
  • 11
  • 13
8
votes
1 answer

UIActivityViewController duplicate url in iOS-11

The url is duplicated when the user choose "Copy" from the activity controller in iOS 11 only. It was working properly on iOS 10 Using the below code @IBAction func shareButtonPressed() { guard let url = URL(string: "http://google.com") else {…
Hani Ibrahim
  • 1,448
  • 11
  • 21
8
votes
1 answer

Share video to Instagram on iOS

Is it possible to share a video on Instagram without saving it to the user's Camera Roll? this is what i tried so far: let instagramURL = URL(string: "instagram://app")! if (UIApplication.shared.canOpenURL(instagramURL)) { …
Eyal
  • 10,777
  • 18
  • 78
  • 130
8
votes
5 answers

UIActivityViewController Change Navigation Bar text color

I am creating a UIActivityViewController and trying to change its text color after tapping the share messages icon. By default, I set my navigation bar text colors to white in the AppDelegate like so UINavigationBar.appearance().tintColor =…
Simon
  • 6,413
  • 6
  • 34
  • 57
8
votes
1 answer

Sharing Video PHAsset via UIActivityController

I am trying to share video PHAsset via UIActivityController using requestAVAsset. This works with Messaging, but not with AirDrop, indicating as 'Failed'. PHCachingImageManager.default().requestAVAsset(forVideo: asset, options: nil, resultHandler: …
Gizmodo
  • 3,151
  • 7
  • 45
  • 92
8
votes
0 answers

Share text and image on whatsapp using UIActivityViewController

With the latest version of whatsapp, I cannot share both text and image at the same time. I tried the below code: let image:UIImage = UIImage(named:"ImageName") objectsToShare = [image,"textToShare"] let activityVC =…
8
votes
1 answer

Argument of #selector cannot refer to a property

The goal is to update the below condition to Swift 2.2 syntax, which advises using #selector or explicitly constructing a Selector. if activityViewController.respondsToSelector("popoverPresentationController") { } However, using the below as a…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
8
votes
1 answer

Excluding own application from UiActivityViewController

I am trying to remove my own applications share extension from showing up in the share options. I can't find any documentation on this online. Any help would be appreciated. This is what I have so far: activityVC.excludedActivityTypes =…
8
votes
1 answer

I need to show my App in UIActivityViewController for All Applications as Action Extension(Default)

Created New Project and Added ActionExtension it worked and shows in Action Activities But Action Extension doesn't show in Device when i created for Existing App(Old App which contains swift and Objective-c Files) I need to show my App in Action…
Sanju
  • 1,148
  • 11
  • 26
8
votes
3 answers

How to create share button in iOS 9?

In my app i want to create a share button with WhatsApp,Facebook,Twitter,Mail like this. Here is my code -(IBAction)share:(id)sender { NSString *shareText = @"Hi This is a Reward Game App"; NSArray *itemsToShare =…
User558
  • 1,165
  • 1
  • 13
  • 37
8
votes
5 answers

UIActivityViewController not passing new line characters to some activities

I am using the following code to set up UIActivityViewController: NSArray *activityItems = [NSArray arrayWithObjects:[self textMessageToShare], nil]; UIActivityViewController *activityViewController = [[UIActivityViewController alloc]…