Instance Method

initWithTitle:image:alternateImage:handler:

Creates a custom sharing service object.

Declaration

- (instancetype)initWithTitle:(NSString *)title image:(NSImage *)image alternateImage:(NSImage *)alternateImage handler:(void (^)(void))block;

Parameters

title

The custom sharing service name.

image

The image that represents the sharing service

alternateImage

The alternate image that represents the sharing service

block

The block that actually interacts with the service.

Return Value

An instance of the custom sharing object.

Discussion

Custom sharing services can be added to the NSSharingServicePicker with the sharingServicePicker:sharingServicesForItems:proposedSharingServices: delegate method.

When implementing this method, consider subclassing NSSharingService so the canPerformWithItems: and sharingServicesForItems: can provide accurate results.

See Also

Creating a Sharing Service

+ sharingServiceNamed:

Returns a sharing service instance representing the specified service name.

NSSharingServiceName

These constants list the available sharing services.