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
2
votes
0 answers

How to get the title and messageBody metadata from the UIActivityViewController to a custom UIActivity?

Since iOS 13 you can create a UIActivityViewController using a UIActivityItemsConfiguration. That has a perItemMetadataProvider callback that allows you to provide a title and message body. With that all setup, if you select standard activities such…
HangarRash
  • 7,314
  • 5
  • 5
  • 32
2
votes
0 answers

Using a PHLivePhoto with a UIActivityViewController

Trying to share as activity a PHLivePhoto within a UIActivityViewController without any result more than the console output: Resource not found (3 times logged) I use the PHLivePhoto request with local URL's from document directory: Both files…
2
votes
1 answer

Add to iCloud Drive with UIActivityViewController

I would like to use UIActivityViewController's "Add to iCloud Drive" action pictured here to upload a file that I store on the iOS device: Currently in my custom UIActivityItemProvider class I have my - (id)item method returning this: …
2
votes
0 answers

UIActivityViewController sharing app name

I am using UIACtivityViewController to to create sharing feature in my app. The problem i am facing is that, the i want to get the real application name which user has used to share the things in my app. There are some default social services which…
Madu
  • 4,849
  • 9
  • 44
  • 78
2
votes
0 answers

How to design a UIActivity activityImage?

I have searched the internet far and wide - there is plenty of stuff out there for what the code should be in the UIActivity subclass. This is not what I'm looking for. I am not a designer. I am a developer who wants to create the actual image. The…
PostCodeism
  • 1,070
  • 1
  • 12
  • 20
2
votes
1 answer

Lost item after sorting item in menu view

I have problem with UIActivity function. The first, I create 3 activity items: activityDownload activityTrash activityMove. And add to UIActivityViewController And then, when I present UIActivityViewController which includes 3 items above. OK, no…
Trần Trung Hiếu
  • 1,373
  • 1
  • 10
  • 12
2
votes
2 answers

iOS native share - Remove sharing options like Linkedin

I'm using a native share to share an image from my app. I've removed unwanted options using excludedActivityTypes. Some apps like Linkedin (which is installed on my device) pops up on native sharing options. How can I remove these unwanted…
2
votes
1 answer

presentOpenInMenuFromBarButtonItem: doesn't cause menu to appear

I am attempting to display an Open In menu via UIDocumentInteractionController and presentOpenInMenuFromBarButtonItem. This does not bring up the UIDocumentInteractionController on screen. The weird thing is that if I replace "OpenIn" with "Options"…
2
votes
0 answers

iOS 7 custom UIActivity as popover

This is my first question on StackOverflow, so please be patient with me... Here's the problem: I have created a custom Activity for adding bookmarks, which is opened from the UIActivityViewController. On iPhone it is opened as a modal, which is…
2
votes
1 answer

UIImage only for the chosen applicationActivities, but NSString for all applicationActivities

I'm using UIActivityViewController for share NSString and UIImage, but I don't want to share the UIImage with iMessage & e-mail. How can I create such a custom UIActivity for UIImage and leave NSString for all?
2
votes
2 answers

UIActivityViewController, activities not being completed, sharing options not loading

I have an app that has a share button. This share button loads a UIActivityViewController for sharing to Facebook, Twitter, email, text message, etc. It used to work fine, and I think it still works fine on the simulator, but on devices, the view…
shim
  • 9,289
  • 12
  • 69
  • 108
2
votes
2 answers

UIActivityViewController or UIDocumentInteractionController with WhatsApp and FB

I need to have Facebook and WhatsApp as sharing options for my image. I've already implemented UIActivityViewController, where i can share via Facebook and UIDocumentInteractionController where i can share via WhatsApp. I don't know how to merge…
Nat
  • 12,032
  • 9
  • 56
  • 103
2
votes
1 answer

HTML email message body with UIActivityViewController

Without subclassing UIActivity, is it possible to use UIActivityViewController (UIActivityTypeMessage) to share a html message via the Mail app? When I passed the HTML as NSString, the body shows the html tags (e.g. ) in the message body which is…
mobileideafactory
  • 1,640
  • 1
  • 22
  • 30
2
votes
2 answers

How to rearrange activities on a UIActivityViewController?

I'm using a UIActivityViewController, but I want to rearrange the order of the available activities. Right now it chooses what order to display them in, and has a bunch of them on a single scrollable line, and then more below a separator. Is it…
Marty
  • 5,926
  • 9
  • 53
  • 91
2
votes
0 answers

How to change the message of an airdrop activity?

I'm sending a URL via AirDrop using a UIActivityViewController. When the receiver gets the alert on their phone, it says "XXX's iPod would like to share xxx". Is there a way to change this text? I tried adding an NSString to the items passed to…
Marty
  • 5,926
  • 9
  • 53
  • 91