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

UIActivityViewController crashing on iOS 8 iPads

I am currently testing my app with Xcode 6 (Beta 6). UIActivityViewController works fine with iPhone devices and simulators but crashes with iPad simulators and devices (iOS 8) with following logs Terminating app due to uncaught exception…
Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64
179
votes
7 answers

Basic example for sharing text or image with UIActivityViewController in Swift

I started my search by wanting to know how I could share to other apps in iOS. I discovered that two important ways are UIActivityViewController UIDocumentInteractionController These and other methods are compared in this SO answer. Often when I…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
92
votes
14 answers

SwiftUI - Half modal?

I'm trying to recreate a Modal just like Safari in iOS13 in SwiftUI: Here's what it looks like: Does anyone know if this is possible in SwiftUI? I want to show a small half modal, with the option to drag to fullscreen, just like the sharing…
ryannn
  • 1,329
  • 1
  • 9
  • 21
74
votes
4 answers

How to set a mail Subject in UIActivityViewController?

I want to set subject for email sharing in UIActivityViewController and also want to share in Twitter. I know in Twitter if we want to share — we need compress text to 140 chars. I checked many SO solutions, but nothing is working. Is this issue…
Femina
  • 1,239
  • 1
  • 12
  • 25
73
votes
15 answers

Showing 'UIActivityViewController' in SwiftUI

I want to let the user to be able to share a location but I don't know how to show UIActivityViewController in SwiftUI.
nOk
  • 2,725
  • 4
  • 13
  • 26
68
votes
20 answers

Cannot set text color of Send and Cancel buttons in the mail composer when presented from the UIActivityViewController in iOS7

I am using the UIActivityViewController to share items in iOS7. When I tap on the Mail option, it pops up the mail composer, but the Cancel and Send buttons on the navigation bar and the navigation bar itself are blue, making it very difficult to…
Jonathan Shih
  • 681
  • 1
  • 5
  • 4
64
votes
4 answers

How can I create a custom UIActivity in iOS?

How can I create a custom UIActivity in iOS? The reason I want this is to add a Review App button in one of my apps that takes the user to the review section in the App Store. How can I create such a custom UIActivity?
klcjr89
  • 5,862
  • 10
  • 58
  • 91
57
votes
9 answers

How to exclude Notes and Reminders apps from the UIActivityViewController?

I am creating a UIActivityViewController and pass String and URL to it. This, obviously, configures the UIActivityViewController to use some items which I want to exclude (my objective is to share the info about my app). I have managed to exclude…
Andriy Gordiychuk
  • 6,163
  • 1
  • 24
  • 59
56
votes
7 answers

I have REAL misunderstanding with MFMailComposeViewController in Swift (iOS8) in Simulator

I create a CSV file and try to send it by e-mail. Displays a window to send mail, but is not filled with the body of the email, and no attached file. Application hangs with this screen: button "Cancel" does not work. After a few seconds in the…
54
votes
4 answers

UIActivityViewController - is there a way to know which activity was selected?

Id like to be able to track if the user shared by facebook, twitter, etc, but it seems there's no way to know which method was selected. Is there?
Adam
  • 1,486
  • 3
  • 20
  • 35
48
votes
3 answers

iOS: How to share text and image on social networks?

Please, can you tell me if I'm doing mistakes? NSString *sharedMsg=[NSString stringWithFormat:@"Hello world"]; UIImage* sharedImg=[UIImage imageNamed:@"image"]; NSArray* sharedObjects=[NSArray arrayWithObjects:sharedMsg, sharedImg,…
user3290180
  • 4,260
  • 9
  • 42
  • 77
45
votes
6 answers

UIActivityViewController for Facebook not Showing Default Text

I am using a UIActivityViewController which provides some default text and a link. With all social mediums (sms, email, twitter) the default text and URL are shown. However, with FB while the URL image is shown, the default text is not showing (it…
C6Silver
  • 3,127
  • 2
  • 21
  • 49
41
votes
8 answers

How to send a PDF file using UIActivityViewController

I'm trying to send a PDF using a UIActivityViewController. So far everything works fine using a fairly basic approach but the one issue I have is that when I select the send by mail option, the PDF's file name is Attachment-1 rather than…
Ian Turner
  • 1,363
  • 1
  • 15
  • 27
39
votes
5 answers

iOS 8.3: UIActivityViewController shows extraneous row

I have a UIActivityViewController for which I have excluded (using excludedActivityTypes) all the UIActivityCategoryAction activity types. In iOS 8.2, the UIActivityViewController would only show one line, for the UIActivityCategoryShare activity…
Randomblue
  • 112,777
  • 145
  • 353
  • 547
39
votes
4 answers

iOS: Warning "attempt to present ViewController whose view is not in the window hierarchy"

I am getting following warning when I try to present a ActivityController on navigation controller, Attempt to present on whose view is not in the window hierarchy! I have…
1
2 3
83 84