Hi,
Inside a Mac Catalyst app, I need to display a popover starting from an NSToolbarItem contained inside the app toolbar (like the Apple Maps Mac app does, see below image).
In order to do that, when I press the button I need to find the toolbar item view and use it as popover anchor.
How can I find the view or frame of an NSToolbarItem on Mac Catalyst?
A property that could help me is the NSToolbarItem "view" property (NSView), but that property has been marked has unavailable in Mac Catalyst.
Any idea?
Thank you
Popovers can be applied to Toolbar items on Ventura and later. There is a new API for that - see UIPopoverPresentationController
// Accepts UIBarButtonItem as well as NSToolbarItem in Catalyst.
@available(iOS 16.0, *)
open var sourceItem: UIPopoverPresentationControllerSourceItem?