Inherits from NSObject
Declared in INKActivityPresenter.h

Overview

INKActivityPresenter is a presenter object responsible for displaying a INKActivityViewController. It will take care of displaying it modally on an iPhone or in a UIPopover on an iPad.

Tasks

Properties

activity

@property (strong, nonatomic) INKActivity *activity
Discussion

An INKActivity to be performed if the user doesn’t need to choose an application (e.g. they only have one installed, or have set a preference). Nil if there is a view controller to be presented instead.

Declared In

INKActivityPresenter.h

activitySheet

@property (strong, nonatomic) INKActivityViewController *activitySheet
Discussion

An INKActivityViewController to be displayed. This will be nil if the user doesn’t need to choose an application (e.g. they only have one installed, or have set a preference).

Declared In

INKActivityPresenter.h

Instance Methods

canPerformActivity

- (BOOL)canPerformActivity
Discussion

Returns whether or not an action will be performed when you try to present the activity sheet.

Return Value

NO if the user has no applications installed capable of handling the action. Otherwise YES.

Declared In

INKActivityPresenter.h

dismissActivitySheetAnimated:

- (void)dismissActivitySheetAnimated:(BOOL)animated
Discussion

Removes the active INKActivityViewController from view.

Parameters

animaed

Whether or not to animate the transition

Declared In

INKActivityPresenter.h

initWithActivity:

- (instancetype)initWithActivity:(INKActivity *)activity
Discussion

Instantiate a INKActivityPresenter with a given INKActivity.

Parameters

activity

The INKActivity whose action will be performed.

Declared In

INKActivityPresenter.h

initWithActivitySheet:

- (instancetype)initWithActivitySheet:(INKActivityViewController *)activitySheet
Discussion

Instantiate a INKActivityPresenter with a given INKActivityViewController.

Parameters

activitySheet

The INKActivityViewController that will be presentd.

Declared In

INKActivityPresenter.h

presentActivitySheetFromViewController:popoverFromBarButtonItem:permittedArrowDirections:animated:completion:

- (void)presentActivitySheetFromViewController:(UIViewController *)presentingViewController popoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated completion:(void ( ^ ) ( ))completion
Discussion

Present the current activity sheet on the given view controller. If the device is an iPhone, it will be presented modally; if an iPad, it will be presented in a UIPopoverController with the given options.

Parameters

presentingViewController

A UIViewController to serve as the activity sheet’s presentingViewController.

item

A UIBarButtonItem to originate the UIPopoverController from

arrowDirections

A bitmask of permitted arrow directions.

animated

Whether or not to animate the popover.

completion

A completion block to be called after the user has dismissed the activity sheet

Declared In

INKActivityPresenter.h

presentActivitySheetFromViewController:popoverFromRect:inView:permittedArrowDirections:animated:completion:

- (void)presentActivitySheetFromViewController:(UIViewController *)presentingViewController popoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated completion:(void ( ^ ) ( ))completion
Discussion

Present the current activity sheet on the given view controller. If the device is an iPhone, it will be presented modally; if an iPad, it will be presented in a UIPopoverController with the given options.

Parameters

presentingViewController

A UIViewController to serve as the activity sheet’s presentingViewController.

rect

The CGRect the UIPopoverController should be originating from.

view

The UIView the UIPopoverController should be displayed in.

arrowDirections

A bitmask of permitted arrow directions.

animated

Whether or not to animate the popover.

completion

A completion block to be called after the user has dismissed the activity sheet

Declared In

INKActivityPresenter.h

presentModalActivitySheetFromViewController:completion:

- (void)presentModalActivitySheetFromViewController:(UIViewController *)presentingViewController completion:(void ( ^ ) ( ))completion
Discussion

Present the current activity sheet modally on a given view controller.

Warning: If your app is either Universal or iPad-only, you should instead use presentModalActivitySheetFromViewController:popoverFromRect:inView:permittedArrowDirections: or presentModalActivitySheetFromViewController:popoverFromBarButtonItem:permittedArrowDirections: instead.

Parameters

presentingViewController

A UIViewController to serve as the activity sheet’s presentingViewController.

completion

A completion block to be called after the user has dismissed the activity sheet

Declared In

INKActivityPresenter.h

presentModally

- (void)presentModally
Discussion

Present the current activity sheet modally.

Warning: This attempts to programmatically determine the topmost view controller and present on that; if that does not work in your app, you probably want to manually pass in a view controller using `presentModalActivitySheetFromViewController:completion.

Declared In

INKActivityPresenter.h

presentModallyWithCompletion:

- (void)presentModallyWithCompletion:(void ( ^ ) ( ))completion
Discussion

Present the current activity sheet modally.

Warning: This attempts to programmatically determine the topmost view controller and present on that; if that does not work in your app, you probably want to manually pass in a view controller using `presentModalActivitySheetFromViewController:completion.

Parameters

completion

A completion block to be called after the user has dismissed the activity sheet.

Declared In

INKActivityPresenter.h