Vladimir Stazhilov
Vladimir Stazhilov

Reputation: 1954

Hide UIPopoverController with double tap

I've got splite-view application and of course there is a popover controller in the vertical DetailView, how can I hide with double-tap? thanks

Upvotes: 0

Views: 462

Answers (1)

Youssef
Youssef

Reputation: 3592

You have to add a doubleTap gesture recognizer and call dismissPopoverAnimated:

First declare a gesture recognizer and configure it to your view:

 UITapGestureRecognizer * doubleTapGesture = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapCallback:)];
 doubleTapGesture.numberOfTapsRequired = 2;
 [yourView addGestureRecognizer:doubleTapGesture];
 [doubleTapGesture release];

Then implement the callback:

- (IBAction) doubleTapCallback: (UITapGestureRecognizer *) sender
{
    [yourPopOverController dismissPopoverAnimated:YES]

}

Upvotes: 2

Related Questions