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
8
votes
1 answer

ios 8 completion block not called

In my app I am using TTOpenInAppActivity to insert "Open in" action inside UIActivityController. Inside it works like this: Some view controller presents UIActivityController with TTOpenInActivity already built in. -(void)openWithAction { NSURL…
8
votes
1 answer

iOS 8 UIActivity: disable specific third-party sharers?

I'm fighting with UIActivityViewController in iOS 8. I'd built a custom Pinterest sharing mechanism which works beautifully in iOS 7 -- specifically, it uploads an image to my server, and then creates a Pin with that image and a URL which I…
DanM
  • 7,037
  • 11
  • 51
  • 86
8
votes
1 answer

UIActivityViewController on iOS 8 show "more" button with custom activities

Now XCode 6 with iOS 8 SDK is out, we can talk about stuff. I tried to use custom activities with UIActivityViewController on iOS 7, everything worked fine. But on iOS 8, when custom activities are shown, there is "more" button sitting next to them…
L N
  • 2,856
  • 4
  • 20
  • 30
8
votes
1 answer

iOS 8 custom UIActivity image black background color

I am trying to add a custom UIActivity of type UIActivityCategoryAction to UIActivityController. But in iOS 8, all of them are appearing with a black background. Is there a way to change this?
8
votes
3 answers

Problems adding custom activity to UIActivityController

I am trying to implement a custom activity to the standard activities (Print, Mail, FaceBook, etc.) but for now only want the standard Print (for AirPrint) and my own custom printing by a direct method. I am obviously missing something fundamental…
bjarne
  • 381
  • 2
  • 3
  • 10
7
votes
1 answer

UIActivityViewController and UIDocumentInteractionController

How do I combine a UIActivityViewController and a UIDocumentInteractionController? The Mail app and the Tumblr app seem to compine a UIActivityViewController with a UIDocumentInteractionController because their controllers also show the "Open in"…
6
votes
2 answers

Sharing images/videos to other apps through UIActivityViewController shows shared items twice in iOS

I'm trying to share some images and videos to other apps(like FB, WhatsApp) using UIActivityViewController. I have sub-classed UIActivityItemProvider, and on calling -(id)item methods, I'm processing the images/videos and saving in documents…
Suran
  • 1,209
  • 1
  • 17
  • 21
6
votes
1 answer

Displaying a progress indicator during UIActivityItemProvider activity

I've got a UIActivityViewController which allows the user to share an image they've created to one of several activity types (facebook, twitter, save to camera roll, print, etc.). Since I want the image to be saved/sent at different quality levels…
DanM
  • 7,037
  • 11
  • 51
  • 86
6
votes
1 answer

How to add custom buttons to UIActivityViewController?

I am using UIActivity in ios7. It is working fine with a few lines of code. Now i want to add instagram share button to it. Is there a way to add custom buttons to the action sheet? This is how i am creating the UIActivityViewController: NSString…
devdev101
  • 241
  • 1
  • 5
  • 14
5
votes
0 answers

Show Print activity button for print using SFSafariviewController

In sfsafariviewcontroller screen, share button is only showing default activity options that doesn't have print option, but i want to show only print activity option. there is delegate method to return activity. i want to return UIPrintActivity…
Saood
  • 273
  • 1
  • 3
  • 17
5
votes
0 answers

Mysterious memory leak with UIActivity and UIActivityViewController

I'm running into what looks like a memory leak using Swift on iOS. Here's a pared-down runnable example — you can tap the screen to show a share sheet, and BadActivity will leak every time. import UIKit class ViewController: UIViewController { …
yurivish
  • 51
  • 3
5
votes
2 answers

Is there a way to specify the image format when using UIActivityViewController on a UIImage?

It seems that the OS chooses whether to use a PNG or JPEG for reasons unknown. In my case, I want a JPEG sent (via mail, twitter, etc.) but I tend to get a very large PNG. If I subclass UIActivityItemProvider and return an NSURL pointing to a file…
akaru
  • 6,299
  • 9
  • 63
  • 102
5
votes
2 answers

Override activity performed by built-in UIActivity types

Is it possible to override the activity that's performed by the built-in UIActivity types used by UIActivityViewController? For example, I would like the Facebook activity to use my own custom view instead of the built-in one. I know you can…
SeanK
  • 667
  • 7
  • 16
5
votes
1 answer

What UIImage should I return from UIActivity activityImage?

I have created a subclass of UIActivity to present a custom activity on the Activity Sheet within my app. However I cannot get it to show my icon. I have tried a few different images at typical icon sizes, e.g.: - (UIImage *)activityImage { …
Bryan
  • 11,398
  • 3
  • 53
  • 78
4
votes
1 answer

Swift 3 UIActivity Subclass problems with override

I just upgraded from swift 2 to swift 3 and I am running into some problems with overriding a property. In swift 2 you could set the activity type like this override func activityType() -> String? { return "com.a.string" } However in swift 3 (in…
DerrickHo328
  • 4,664
  • 7
  • 29
  • 50
1
2
3
9 10