preferredPasteboardType(from:restrictedToTypesFrom:)
Returns whatever type on the pasteboard would be most preferred for copying data.
Declaration
func preferredPasteboardType(from availableTypes: [NSPasteboard.PasteboardType], restrictedToTypesFrom allowedTypes: [NSPasteboard.PasteboardType]?) -> NSPasteboard.PasteboardType?Parameters
- availableTypes:
The types currently available on the pasteboard.
- allowedTypes:
Types allowed in the return value. If
nil, any available type is allowed.
Return Value
The preferred type to provide given the available types and the allowed types.
Discussion
You should not need to override this method. You should also not need to invoke it unless you are implementing a new type of pasteboard to handle services other than copy/paste or dragging.