Closed 128keaton closed 9 years ago
@128keaton - Were you able to solve this ??
@mdaymond I ended up not using the popover.
Well, same issue. Any more ideas?
UIWindow mainWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; for (UIView view in mainWindow.subviews) { if (view.class == [WYPopoverOverlayView class]) { [(WYPopoverOverlayView *)view touchesBegan:nil withEvent:nil]; } NSLog(@"Subviews %@", mainWindow.subviews); }
is how I accomplished it
Even easier! And in Swift: Parent View (with Popover Controller):
override func viewDidLoad(){
NSNotificationCenter.defaultCenter().addObserver(self, selector: "dismissPopover", name: "dismissPopover", object: nil)
}
func dismissPopover(){
self.popoverController?.dismissPopoverAnimated(true)
}
The actual Popover's View Controller:
func save(){
NSNotificationCenter.defaultCenter().postNotificationName("dismissPopover", object: nil)
}
Hey everyone, I am having an odd issue thats easy to solve, I probably just can't see it. Basically, I am trying to programmatically dismiss the popover from the popover, for which I haven't had success with. Here is the code I am trying (hooked up to a button in the popover): [self.delegate dismissPopoverAnimated:YES]; where delegate is set to: selectionViewController.delegate = (MasterViewController*) self.view.window.rootViewController; MasterViewController is the view controller from which I am instigating the popover. Any suggestions?