UIKit.UIActivity Class
Abstract base class of activities to which the UIKit.UIActivityViewController can send data.

See Also: UIActivity Members


[Foundation.Register("UIActivity", true)]
public class UIActivity : Foundation.NSObject

See Also



The UIKit.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 UIActivityType.PostToFacebook, UIActivityType.Mail, and UIActivityType.Message.

You can create a new service by subclassing UIKit.UIActivity and, optionally, UIKit.UIActivityItemProvider. This service will only be available to your own application; there is no way to make for non-Apple developers to make a UIKit.UIActivity that is available across apps.

When subclassing, you should override the UIKIt.UIActivity.Image, UIKIt.UIActivity.Title, UIKIt.UIActivity.Type, UIKIt.UIActivity.Prepare and UIKIt.UIActivity.CanPerform.

c# Example

// 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[] {
this.PresentViewController(controller, true, null)


Related content


Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: