Reputation: 1391
In my OS X app built with Swift, I show a popover when the user is not logged in. The user logs in via the popover. How do I then detect at the view controller that launched the popover that the popover has been dismissed?
Upvotes: 0
Views: 506
Reputation: 22343
As @Koen mentioned, you should check NSPopoverDidCloseNotification
and call a method, if the popover did close:
NSNotificationCenter.defaultCenter().notificationCenter.addObserver(
self,
selector: "popOverClosed:",
name:NSPopoverDidCloseNotification,
object: nil
)
That way the popOverClosed
method gets called everytime the popover dismisses.
func popOverClosed(sender : AnyObject) {
//PopOver Dismissed
}
Upvotes: 1