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
1
vote
1 answer

Customize the behavior of UIActivityTypePostToFacebook inside of UIActivityItemProvider

I don't believe there is a way to do what I am about to ask, but I figure I would ask just in case. I am currently subclassing UIActivityItemProvider in order to provide customized messages for various social media platforms: - (id)item { if…
AbuZubair
  • 1,236
  • 14
  • 20
1
vote
0 answers

Issue With Texting From UIActivitySheet On Some Phones

My app has an action button to pull up a UIActivityViewController. On my test device 5S, it will do everything fine, including texting. However, on my 5C test device, it crashes upon trying to send a Message. Is there something wrong with my code…
1
vote
1 answer

UIActivityViewController : Possible to implement flow with a configuration step?

An app I am building needs functionality to share video. I have successfully implemented a UIActivityViewController for this, with a custom UIActivityItemProvider to dynamically generate the video output. However, I would like the user to be able…
adriaan
  • 1,574
  • 14
  • 33
1
vote
1 answer

How can I send emails from my custom UIActivity class?

I made a costume UIActivity class. I like to send emails with attachments with the class, but I can't send emails, or present any ViewControllers from the class. I am trying to present the Mail ViewController with this: -…
1
vote
1 answer

Perform upload after user selects Activity from UIActivityViewController - Possibly an issue with blocks

I want to perform an upload task once a user has selected a share activity from UIActivityViewController, but before the share sheet is shown. Specifically, I need the url of the uploaded image to use in the Activity. I already have subclassed…
Darren
  • 10,182
  • 20
  • 95
  • 162
1
vote
1 answer

Customise performAction of UIActivityTypePostToTwitter

when presenting UIActivityViewController, I want to send the message directly instead of presenting composing dialog when user select "Twitter" or "Facebook". Is it possible to do this? or I have to create a new UIActivity to do this?
fengd
  • 7,551
  • 3
  • 41
  • 44
1
vote
1 answer

Custom UIActivity with custom Data

i have some images & text that i want to share via Facebook,twitter ,it works fine , although i want to share another set of data ( activityitems ) with my custom UIActivity NSLog(@"The Selected Photo Count %i",[self.selectedPhotos…
TALAA
  • 6,184
  • 1
  • 13
  • 21
1
vote
1 answer

UIActivityViewController not dismissing

I'm trying to add a custom UIActivity to a UIActivityController. When I click on the item, it presents the view controller I want it to, but when I finish with that view controller, the original UIActivityViewController is still there. My question…
Chris Loonam
  • 5,735
  • 6
  • 41
  • 63
1
vote
0 answers

Get data to other ViewController with custom UIActivity

I try to add custom icon to UIActivity, and i did it, but i can't set UIACtivity. I want hat when i click the icon open other ViewController and take text and image from UIActivity. I have this code - (UIViewController *)activityViewController { …
N1ceMan
  • 11
  • 1
1
vote
1 answer

UIActivity and AVAsset data type usage

According to the UIActivity Class documentation it is possible to add AVAsset objects as a datasource to UIActivityTypePostToFacebook activity. Does it mean that we can post videos using the standard UIActivityTypePostToFacebook activity type? If…
voromax
  • 3,369
  • 2
  • 30
  • 53
1
vote
1 answer

iOS6 UIActivity tweetsheet text not populating

I'm using UIActivity class for the first time, with very little modification: NSString *textToShare = @"my text"; UIImage *imageToShare = [UIImage imageNamed:@"myImage.png"]; NSArray *itemsToShare = @[textToShare, imageToShare]; …
j9suvak
  • 1,120
  • 2
  • 9
  • 14
0
votes
1 answer

UIActivityViewController no longer displaying application activity icons under iOS 17

I'm just now testing my app under iOS 17 (beta 7). One strange issue I'm seeing is with UIActivityViewController. My app provides several custom application UIActivity instances. Under iOS 17.0 beta 7 on an iPhone 14 Pro simulator, none of the icons…
HangarRash
  • 7,314
  • 5
  • 5
  • 32
0
votes
1 answer

UIActivityViewController ignoring excludedActivityTypes

I need to exclude .saveToCameraRoll from a UIActivityViewController but it is ignoring excludedActivityTypes. activityVC = UIActivityViewController(activityItems: [imgUrl], applicationActivities: activities) activityVC!.excludedActivityTypes =…
Jeshua Lacock
  • 5,730
  • 1
  • 28
  • 58
0
votes
1 answer

Understanding Which Activity Gets Called in Sharing SwiftUI

On my share sheet I see those activities but I want to understand and fetch which activity is selected to share the url. For example, if WhatsApp is selected I want to fetch WhatsApp selected bool somehow. struct ShareSheet:…
Mert Köksal
  • 817
  • 1
  • 7
  • 26
0
votes
1 answer

Why is my custom UIActivity no longer visible in a UIActivityViewController?

I have created a custom UIActivity and it was working, and I presented that UIActivityController as per typical tutorials (e.g. here). When configuring that controller I disabled basically all the services: let items = [location] let…
horseshoe7
  • 2,745
  • 2
  • 35
  • 49