How to make sharing menu in SwiftUI for macOS
Issue #718
Use NSSharingService.sharingServices(forItems:)
with an array of one empty string gives a list of sharing items. There we show image
and title
of each menu item.
We should cache sharing items as that can cause performance issue
1 | import SwiftUI |
Alternative, you can trigger NSSharingServicePicker
from a button, it shows a context menu with sharing options
Read more
Updated at 2020-12-25 22:57:57