Skip to content

Instantly share code, notes, and snippets.

@hawkfalcon
Last active March 31, 2019 07:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawkfalcon/335f7b13ed72741cbe01247cbf2be5a9 to your computer and use it in GitHub Desktop.
Save hawkfalcon/335f7b13ed72741cbe01247cbf2be5a9 to your computer and use it in GitHub Desktop.
Share Sheet NSSharingServicePicker
@IBAction func shareSheet(_ sender: NSButton) {
let text = "Text to share..."
let sharingPicker = NSSharingServicePicker(items: [text])
sharingPicker.delegate = self
sharingPicker.show(relativeTo: NSZeroRect, of: sender, preferredEdge: .minY)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment