How to show context popover from SwiftUI for macOS
Issue #630
For SwiftUI app using NSPopover
, to show context popover menu, we can ask for windows
array, get the _NSPopoverWindow
and calculate the position. Note that origin of macOS screen is bottom left
1 | (lldb) po NSApp.windows |
1 | let handler = MenuHandler() |