Questions tagged [uiactivity]

The UIActivity class is an abstract class that you subclass in order to implement application-specific services. A service takes data that is passed to it, does something to that data, and returns the results. For example, a social media service might take whatever text, images, or other content is provided to it and post them to the user’s account. Available in iOS 6.0 and later in UIKit.

The UIActivity class is an abstract class that you subclass in order to implement application-specific services. A service takes data that is passed to it, does something to that data, and returns the results. For example, an social media service might take whatever text, images, or other content is provided to it and post them to the user’s account. Activity objects are used in conjunction with a UIActivityViewController object, which is responsible for presenting services to the user.

You should subclass UIActivity only if you want to provide custom services to the user. The system already provides support for many standard services and makes them available through the UIActivityViewController object. For example, the standard activity view controller supports emailing data, posting items to one of the user’s social media accounts, and several other options. You do not have to provide custom services for any of the built-in types.

Subclassing Notes

This class must be subclassed before it can be used. The job of an activity object is to act on the data provided to it and to provide some meta information that iOS can display to the user. For more complex services, an activity object can also display a custom user interface and use it to gather additional information from the user.

136 questions
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
35
votes
5 answers

UIActivityViewController - Email and Twitter sharing

I recently started working with UIActivity to share my app to the world, but I have few problems. First, I didn't find how to set the subject of my email. Is there any way? Second, when I set the body text of my email, there is a extra "enter"…
anthoprotic
  • 827
  • 2
  • 13
  • 24
28
votes
1 answer

UIActivityViewController thinks my jpg is video when share by file URL

I have jpg files saved in the Documents directory that can be shared from a standard UIActivityViewController. All activity items (including Save Image) work as expected, but when Save Image is tapped, the following error shows in the console,…
Paul B.
  • 458
  • 3
  • 6
13
votes
4 answers

UIActivity activityViewController being presented modally on iPad instead of in popover

When using a customer UIActivity subclass in iOS 6, it's possible to specify a custom view controller that will be displayed when your action is chosen from the initial UIActionViewController's view. You do this by returning a reference to a custom…
Kudit
  • 4,212
  • 2
  • 26
  • 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
4 answers

UIActivityViewController with custom UIActivity displays color image as gray

I created a custom UIActivity to display in a share sheet. I created an 60x60 icon (png file) in full color, but when it's displayed it only shows the outline in gray. I don't see what I've written incorrectly. I hope someone sees what I've…
Rob
  • 4,149
  • 5
  • 34
  • 48
11
votes
3 answers

UIActivityViewController With Alternate Filename?

I am sharing an audio recording via the UIActivityViewController. When the audio file shares via email or iMessage, it shows the underlying name of the audio file without any apparent way of changing it. NSArray *activityItems = [NSArray…
11
votes
2 answers

UIActivity with no settings for Facebook

Is it possible to show Facebook UIActivity in UIActivityViewController if there's no settings for facebook account in default iOS settings? For now if I enter some fb account - I see fb in UIActivityViewController, if no - not see. Any ideas?
in.disee
  • 1,102
  • 1
  • 7
  • 15
10
votes
2 answers

Limiting UIActivityViewController share extension activities

I'm using UIActivityViewController with several custom UIActivityProviders. My providers return NSString, UIImage, and custom data objects. I exclude activities I don't want to share by setting UIActivityViewController excludedActivityTypes and…
Dan
  • 631
  • 6
  • 20
10
votes
1 answer

Example of how to customize UIActivityViewController share menu?

Is there an example of how to customize UIActivityViewController share menu with my own icon and IBAction? I have seen this... - (id)initWithActivityItems:(NSArray *)activityItems applicationActivities:(NSArray *)applicationActivities; but I have…
OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
9
votes
4 answers

UIActivity custom share, thumbnail icon not be shown when touch more button

My app support iOS 7+, I use UIActivity image size: 60pt for iPhone, 76pt for iOS for iPad, When touch more button to re-order the items, it can't show the icon in the list. CODE as below: class ZYShare { class ActivityItem { init() { …
ZYiOS
  • 5,204
  • 3
  • 39
  • 45
9
votes
2 answers

How to cancel UIActivityItemProvider and don't show activity?

I'm using UIActivityItemProvider subclass to provide custom data. But sometimes getting data fails and I don't want to present activity (e.g. message composer). Tried [self cancel] and return nil; in item method, but message composer still shows…
feduza
  • 101
  • 3
9
votes
2 answers

Override UIActivityViewController default behaviour

In the Photos app on the iPhone, when you select the Mail sharing option, the photo animates into the modal view controller that slides up. How is it possible to modify the behaviour of the built-in UIActivities? For example, I'd like to be able to…
user376845
9
votes
8 answers

UIActivity activityViewController not dismissing on iPad

I have a UIActivity subclass that creates its own activityViewController: - (UIViewController *)activityViewController { WSLInProgressViewController* progressView = [[[WSLInProgressViewController alloc] init] autorelease]; …
Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
1
2 3
9 10