3
votes

I've got a weird issue with segues - I have a segue open a popover when a UIButton is tapped, all of this done through IB. (This is on iPad)

But when I select an option from the Tableview on this popover I want it to dismiss the popover. And I don't want the popover to open twice if the user taps that UIButton twice..

The way things work by default, tapping that UIButton keeps opening popovers on top of each other "forever" and also I still have the issue that when a cell from my Tableview is tapped, the popover remains.

How can I solve these problems?

2

2 Answers

0
votes

Use prepareForSegue: method to dismiss the pop over if it is already present.

Here is given, how to use that method.

0
votes

Prevent multiple popovers:

Use an if statement to determine whether a popover is present or not, if it isn't present it, if it is don't.

Dismiss on cell tap:

In didSelectRowAtIndexPath call dismissPopover on your popover view.