Skip to content

Commit

Permalink
Fix: Dismiss popover view when toolbar button is touched again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Katzian committed Jun 15, 2010
1 parent 928583c commit 9c33dc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions PopoverView/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ @implementation MainViewController

//method which gets called when button at toolbar was activated
- (void) toolbarAction:(id) sender {

if([self.popoverController isPopoverVisible])
{
//close the popover view if toolbar button was touched
//again and popover is already visible
//Thanks to @chrisonhismac

[self.popoverController dismissPopoverAnimated:YES];
return;
}

//build our custom popover view
UIViewController* popoverContent = [[UIViewController alloc]
init];
Expand Down

0 comments on commit 9c33dc4

Please sign in to comment.