Instance Method

itemSet(withPasteboardTypes:)

Returns an index set identifying pasteboard items having the specified representation types.

Declaration

func itemSet(withPasteboardTypes pasteboardTypes: [String]) -> IndexSet?

Parameters

pasteboardTypes

An array of strings, with each string identifying a representation type. Typically you use UTIs as pasteboard types.

Return Value

An index set with each integer positionally identifying a pasteboard item that has one of the representation types specified in pasteboardTypes.

Discussion

You can pass the index set returned in this method in a call to data(forPasteboardType:inItemSet:) or values(forPasteboardType:inItemSet:) to get the data in the indicated pasteboard items.

See Also

Determining the Types of Multiple Pasteboard Items

var numberOfItems: Int

Returns the number of items in the pasteboard

func types(forItemSet: IndexSet?) -> [[String]]?

Returns an array of representation types for each specified pasteboard item.

func contains(pasteboardTypes: [String], inItemSet: IndexSet?) -> Bool

Returns whether the specified pasteboard items contain data of the given representation types.