Instance Method

canPerform(withItems:)

Returns whether the service can share all the specified items.

Declaration

func canPerform(withItems items: [Any]?) -> Bool

Parameters

items

The items to share.

Return Value

true if the service can share all the items; false otherwise. If items is nil, the method will return true when the service is configured.

Discussion

This method can be used to validate a custom user interface such as a dedicated Twitter button. Therefore you could call it once at launch time with nil items to check whether to display the button or not, and then with real items to enable and disable the button depending on the context or selection.

See Also

Sharing Items

func perform(withItems: [Any])

Manually performs the service on the provided items.

var recipients: [String]?

An array containing the user handles of the desired recipients.