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
21
votes
4 answers

iOS 10 app crashes when trying to save image to photo library

I'm trying to save an image to the photo library in Swift 3 (I'm working with Xcode 8). ViewController Code: func shareImage(image: UIImage) { let items = [image] var activityVC: UIActivityViewController =…
21
votes
5 answers

UIActivityViewController in Swift Crashes on iPad

I am making a share function in my game and I have the code and it works fine on iPhone but when I test it on a iPad, when I tap the share button the app crashes. I am using the following code for the share button let textToShare = "Check out this…
Loanb222
  • 841
  • 1
  • 11
  • 29
20
votes
2 answers

How do I use UIActivityItemProvider to send an email with attachment with UIActivityViewController?

I am trying to use UIActivityItemProvider to share a file from within my app via email attachment. I also need to populate the subject line of the email and to specify the name of the attachment to be something different than the name of the file…
RawMean
  • 8,374
  • 6
  • 55
  • 82
19
votes
2 answers

UIActivityItemSource Protocole set complex object

I'm using iOS 6 new way to share information : UIActivityViewController. To select the shared data depending on the media (facebook, twitter or mail) my view controller implement the UIActivityItemSource Protocol as follow : -…
Thomas Besnehard
  • 2,106
  • 3
  • 25
  • 47
18
votes
2 answers

UIActivityViewController doesn't show FB and Twitter on iOS 7

I am trying to share some items using UIActivityViewController. On iOS 6 it works fine. But when I test it on iOS 7 only mail icon shows up. In doubt that my SDK was too old I downloaded the most recent one, but it's still behaves the same. I tested…
Au Ris
  • 4,541
  • 2
  • 26
  • 53
17
votes
1 answer

UIActivityViewController unable to set subject when sharing to Gmail app

I see via sharing content from other apps that it is possible to set a different subject and body when using share sheet to share into the Gmail Mail app. I have implemented it and it works fine on the native mail app but not Gmail. Going into Yelp…
Kris Gellci
  • 9,539
  • 6
  • 40
  • 47
17
votes
7 answers

UIActivityViewController on iPad

I have been using the code below to show a UIActivityViewController which worked fine when I was using Xcode 6, Swift 1.2 and iOS 8. However when I updated it shows the UIActivityViewController but it is completely blank without any of the sharing…
Tom Coomer
  • 6,227
  • 12
  • 45
  • 82
17
votes
6 answers

Modal status bar and navigation bar text colors from UIActivityViewControllers in iOS 7

When I'm using a UIActivityViewController, after the user chooses an activity (such as Mail or Message), I can not change the text color for the status bar nor the text/tint color of the Cancel and Send navigation bar buttons. For the bar buttons,…
HGDev
  • 2,203
  • 2
  • 17
  • 23
17
votes
3 answers

UIActivityViewController in iOS 7

In my app I have added these lines of code to incorporate the functionality of uiactivityviewcontroller UIImage *yourImage = someImg; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:[NSArray…
Amitabha
  • 1,664
  • 1
  • 12
  • 30
16
votes
1 answer

How to perform action after UIActivityViewController called and then closed

I can't understand how to perform actions after UIActivityViewController is called. For example when I save image with the following code: let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() let activity =…
Denis Blinov
  • 243
  • 3
  • 8
16
votes
5 answers

Facebook is not shown in UIActivityViewController but twitter does

My iOS is 8.1.2 and I am using the UIActivityViewController for social sharing. I click on a button and allow the UIActivityViewController to present - (IBAction)UIActivityTypeButtonClick:(id)sender { NSString* text=@"I am sharing this…
Rajan Maheshwari
  • 14,465
  • 6
  • 64
  • 98
15
votes
5 answers

SwiftUI exporting or sharing files

I'm wondering if there is a good way export or share a file through SwiftUI. There doesn't seem to be a way to wrap a UIActivityViewController and present it directly. I've used the UIViewControllerRepresentable to wrap a UIActivityViewController,…
MScottWaller
  • 3,321
  • 2
  • 24
  • 47
15
votes
2 answers

How to receive sharing content in my app?

I would like to add my app to the UIActivityViewController in other apps. How can I add/register my app to allow other apps to send content to my app? How should I receive this content?
Alberto Segura
  • 437
  • 4
  • 9
15
votes
4 answers

UIActivityViewController is not working in iOS 11

I am using UIActivityViewController to share a article url, using the below code, UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:shareItemArray…
R. Mohan
  • 2,182
  • 17
  • 30
15
votes
2 answers

How do I get the "Open in Safari" icon to appear when sharing a URL using UIActivityViewController?

I'm struggling to get my application to share a URL properly so that the "Open in Safari" and "Open in Chrome" activity items show up in the share sheet. I've tried sharing the URL a few different ways: NSURL *data =…
Blake
  • 1,168
  • 1
  • 14
  • 15
1 2
3
83 84