Instance Method


Notifies the system that your activity object has completed its work.


func activityDidFinish(_ completed: Bool)



Specify true if the service executed to completion or false if the service was canceled or did not finish because of an error.


This method dismisses the sharing interface provided by the UIActivityViewController object. If you provided a view controller using the activityViewController method, this method dismisses that view controller too.

You must call this method after completing the work associated with this object’s service. This is true regardless of whether you used the activityViewController or perform() method to initiate the service. When calling the method, use the Boolean value to indicate whether the service completed successfully.

This method must be called on the main thread.

See Also

Performing the Activity

func canPerform(withActivityItems: [Any]) -> Bool

Returns a Boolean indicating whether the service can act on the specified data items.

func prepare(withActivityItems: [Any])

Prepares your service to act on the specified data.

var activityViewController: UIViewController?

Returns the view controller to present to the user.

func perform()

Performs the service when no custom view controller is provided.