A service that lets users share content with other services, such as social media services, or apps, such as Mail and Safari.
- macOS 10.8+
NSSharing class is used to provide a consistent user experience when sharing items—
NSImage objects, video (through file URLs), or any object that implements the
NSPasteboard protocol—in macOS.
For any item or group of items, the
NSSharing displays a sharing sheet that lets the user visualize what will be shared to the service. A sharing service can: create a post on a social network like Twitter or Facebook, send a message by email or iMessage, upload videos to viewing services, or send a file by AirDrop.
It's possible for developers to use
NSSharing directly. For example, they can create a button that will trigger a service as shown in this code snippet: