Type Method

pasteboardWithName:create:

Returns a pasteboard identified by name, optionally creating it if it doesn’t exist.

Declaration

+ (UIPasteboard *)pasteboardWithName:(UIPasteboardName)pasteboardName create:(BOOL)create;

Parameters

pasteboardName

A string or string constant that identifies (or should identify) the pasteboard.

To create a pasteboard with a nil name, specify a nil value for this parameter.

create

A Boolean value that indicates whether the pasteboard should be created if it doesn’t already exist. Specify NO for system pasteboards or if you want an existing app pasteboard.

Return Value

A pasteboard object that can be used for transferring data within an app or between apps that have the same team ID.

Discussion

Call this method to create custom app pasteboards. (You can also use it to obtain the general pasteboard, but the generalPasteboard class method exists for that purpose.) App pasteboards returned by this method are not persistent, existing only until the app quits. Starting in iOS 10, persistent named pasteboards are deprecated. Instead use a shared container, as described in the overview for the UIPasteboard class.

See Also

Getting and Removing Pasteboards

generalPasteboard

Returns the systemwide general pasteboard, which is used for general copy-paste operations

+ pasteboardWithUniqueName

Returns an app pasteboard identified by a unique system-generated name.

+ removePasteboardWithName:

Invalidates the designated app pasteboard.