How to close the popover programmatically in Safari App Extension?

I have created application for safari app extension with popover and I want to close the popover programmatically.
How I can close the popover in Safari App Extension?
Thanks in advance.

Replies

AFAIK there is no programatic access to the lifecycle of the popover window. My solution for giving the user feedback in interacting with the popover was to briefly change my Save button to have the label of Saving... for one second.


Very annoying!

The latest Mojave beta has an API to close the extension popover programatically.


From the popover's view controller, you can just call [self dismissPopover];


https://developer.apple.com/documentation/safariservices/sfsafariextensionviewcontroller/3075407-dismisspopover?language=objc