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

See Also: UIActivity Members

Syntax

[MonoTouch.Foundation.Register("UIActivity", true)]
[MonoTouch.ObjCRuntime.Availability(Introduced=MonoTouch.ObjCRuntime.Platform.iOS_6_0)]
public class UIActivity : MonoTouch.Foundation.NSObject

See Also

UIActivityViewController

Remarks

The MonoTouch.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 MonoTouch.UIKit.UIActivity and, optionally, MonoTouch.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 MonoTouch.UIKit.UIActivity that is available across apps.

When subclassing, you should override the MonoTouch.UIKIt.UIActivity.Image, MonoTouch.UIKIt.UIActivity.Title, MonoTouch.UIKIt.UIActivity.Type, MonoTouch.UIKIt.UIActivity.Prepare and MonoTouch.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[] {
        UIActivityType.PostToWeibo,
        UIActivityType.Message
    }
};
this.PresentViewController(controller, true, null)

	

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0