I have a UITableView cell with several UITextFields in it. When a user clicks into one of the textFields, a popover appears with some information. At first, they then had to click outside of either the textField or the popover to clear the popover before then clicking into the next textField. I therefore then added the cell’s contentView to the popover controller’s passThroughViews property so they can click through the different textFields in that cell at will without having to dismiss the popover controller first. However, it keeps the original popover open (which) is fine, and then opens another identical popover as well.
Is there a way I can tell if a popover is already open before sending the command to open another? I can’t think of how to detect this?
OK, I did it. For others who find this question. In addition to the other answers, this is how I did it.
I made my view controller a
UIPopoverControllerDelegate.I then created an
BOOLcalledmyPopoverControllerOpen.When I created my popover I set the
BOOLto yes. Using the delegate methodpopoverDidDismissPopoverI then set theBOOLback toNO.I then check on the state of this
BOOLbefore presenting the popover.