UIActivity Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Abstract base class of activities to which the UIActivityViewController can send data.
[Foundation.Register("UIActivity", true)]
public class UIActivity : Foundation.NSObject
[<Foundation.Register("UIActivity", true)>]
type UIActivity = class
inherit NSObject
- Inheritance
- Attributes
Remarks
The UIActivityViewController can be used to send data to services such as social networks, email, SMS, etc. The operating system provides a number of these, such as PostToFacebook, Mail, and Message.
You can create a new service by subclassing UIActivity and, optionally, UIActivityItemProvider. This service will only be available to your own application; there is no way to make for non-Apple developers to make a UIActivity that is available across apps.
When subclassing, you should override the Image, Title, Type, Prepare(NSObject[]) and CanPerform(NSObject[]).
//
// Share an image
//
var imageToShare = UIImage.FromFile ("demo.png");
var activityItems = new NSObject[] { imageToShare };
var controller = new UIActivityViewController (activityItems, null);
this.PresentViewController(controller, true, null)
//
// Now share the image, but explicitly exclude posting as a message
//
controller = new UIActivityViewController (activityItems, null) {
ExcludedActivityTypes = new NSString[] {
UIActivityType.PostToWeibo,
UIActivityType.Message
}
};
this.PresentViewController(controller, true, null)
Constructors
| Name | Description |
|---|---|
| UIActivity() |
Creates a new UIActivity with default values. |
| UIActivity(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| UIActivity(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
Properties
| Name | Description |
|---|---|
| AccessibilityAttributedUserInputLabels | (Inherited from NSObject) |
| AccessibilityRespondsToUserInteraction | (Inherited from NSObject) |
| AccessibilityTextualContext | (Inherited from NSObject) |
| AccessibilityUserInputLabels | (Inherited from NSObject) |
| Category | |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| DebugDescription | (Inherited from NSObject) |
| Description | (Inherited from NSObject) |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| Image | |
| IsDirectBinding | (Inherited from NSObject) |
| IsProxy | (Inherited from NSObject) |
| RetainCount | (Inherited from NSObject) |
| Self | (Inherited from NSObject) |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| Title | |
| Type | |
| ViewController | |
| Zone | (Inherited from NSObject) |