Reputation: 2584
We have a uipopovercontroller displaying some choices the user can make. Nearby is a GO button that starts a search. We need to have the popover be dismissed but still allow the GO button to be triggered with one tap. In the past we used a manual popover control which handled this easily and this is what the customers are used to. Any ideas on how to get this behavior but using Apple's UIPopoverController dismissal?
Upvotes: 0
Views: 114
Reputation: 18561
First I'd checkout passthroughViews
. They will allow you to tell it that the button is allowed to be touched while the popover is active.
passthroughViews
An array of views that the user can interact with while the popover is visible.
@property (nonatomic, copy) NSArray *passthroughViews Discussion When a popover is active, interactions with other views are normally disabled until the popover is dismissed. Assigning an array of views to this property allows taps outside of the popover to be handled by the corresponding views.
Availability Available in iOS 3.2 and later.
Next in your GO button selector you just need to handle the popover with a dismissal:
[popoverController dismissPopoverAnimated:YES];
Upvotes: 1