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

ios: Let people share link/image/text TO my app

How can I make my app to appear in Share activity list of Safari, photos, etc.? I would like to let people share link/image or text through my app like they do on facebook. Facebook/Twitter etc. are available in default UIActivityType list, but how…
optimus
  • 876
  • 1
  • 9
  • 19
4
votes
1 answer

UIActivityViewController completion handler is !completed when using AirDrop

I am using UIActivityViewController to share some text and url which works great when sending some text and a url. I currently need to use the completion handler to perform additional actions depending whether the user cancelled the…
Darren
  • 10,182
  • 20
  • 95
  • 162
4
votes
1 answer

iOS: sharing a transparent UIImage w/ UIActivityViewController?

So I am using UIActivityViewController to let users share or save an image they create with my app. I include a UIImage as one of the share items, it all works fine. Except: it is possible to create this image with some transparent areas. And it…
DanM
  • 7,037
  • 11
  • 51
  • 86
4
votes
1 answer

Implementing UIActivity subclass for Facebook Messenger iPhone App?

Hello I'm implementing different ways in my project to share some TEXT to other Chat Applications, such as: Whatsapp, Line and WeChat. I have no problem to implement this UIActivity subclass using following libs: Whatsapp…
jalopezsuarez
  • 414
  • 4
  • 13
4
votes
1 answer

Twitter absent when using multiple UIActivityProvider classes

I’m refactoring my code to use UIActivitiy and UIActivityProvider. I ran into a problem where Twitter did not show up any longer in the UIActivityViewController. I discovered Twitter would not show up if more than one of my UIActivityProvider…
Dan
  • 631
  • 6
  • 20
4
votes
3 answers

UIActivityViewController use items in specific actions

I have a UIActivityViewController and i want to make it have all the actions safari does and more. Currently i can only get mail, messages, twitter, facebook and a semi-working copy. I set the activity items array with a url. I then added a nsstring…
3
votes
0 answers

UIActivityViewController get activity name in iOS

How can I get selected activity name? I can only get activity type from completionWithItemsHandler. Here is an example: let activityViewController = UIActivityViewController(activityItems: items, …
user1526474
  • 925
  • 13
  • 26
3
votes
2 answers

App Crash while trying to share information through slack using UIActivityViewController

I am using an UIActivityViewController to show share options. The information I am trying to share consists of two pieces (a plain string and an url). The share is working through all the extensions like iMessages, Mail, Notes, Twitter, Facebook…
3
votes
1 answer

Customize share message based on ActivityType, in Xamarin iOS

I'm trying to make a UIActivityViewController and taler each message to the Activity Type (Email/SMS/Facebook/Twitter/etc). I've read many ways people do this in objective c. But I can't get it working with Xamarin/Monotouch for some reason. Has…
LampShade
  • 2,675
  • 5
  • 30
  • 60
3
votes
0 answers

UIActivity Subclass Mail

I am using UIActivityViewController to share data from my app. I know how I can create a custom UIActivity subclass and include that on my share sheet. However, is it possible to customise the system activities? For example, I want to send some data…
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
3
votes
1 answer

What's the difference between these two UIActivityType for Facebook sharing?

When I share contents via Facebook in the iOS application, inside the method - (id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType the activityType is…
lozy219
  • 561
  • 4
  • 18
3
votes
0 answers

Prevent third-party extensions from appearing in Open In list of apps

In my app I've implemented a custom activity in the Share Sheet titled Open In, and tapping this icon will generate a .txt file and present a list of applications that are capable of opening and working with this generated .txt file. iOS…
3
votes
1 answer

Return text, url and image in UIActivityItemProvider

I am subclassing UIActivityItemProvider for my UIActivityViewController so that when the user selects UIActivityTypeMessage it will only show a message, but if the user selects UIActivityTypeFacebook it will show a message with an image. This is my…
SleepNot
  • 2,982
  • 10
  • 43
  • 72
3
votes
0 answers

How to get completion callback from MFMailComposeViewController when it's presented by a UIActivityViewController?

I think I can use the completion handler of the UIActivityViewController (haven't tested yet), but that would only give me a BOOL for whether the activity completed or not. I want to be able to handle the error if there is one, as I would in…
Marty
  • 5,926
  • 9
  • 53
  • 91
3
votes
2 answers

Make custom item in UIActivityViewController icon colorful?

I follow the steps in How can I create a custom UIActivity in iOS? It works as expected. It looks like iOS force a metallic look&feel for all custom icons as well as its own "Bookmark", "Print", etc. Anyway to make my icon colorful?
Espina
  • 83
  • 7
1 2
3
9 10