Search code examples
iosstoryboarduipopovercontroller

Putting a UIPopvercontroller in a storyboard uicontainer view


I am writing a small iPad app using Storyboards. On the first screen the user will be presented with about 7 pieces of information to enter.

Several pieces of information are of the form "How important is X to you" with 5 or 6 possible answers, like "Extremely Important" and "Very Important" and so on.

I think the correct design pattern is to have a Button on the storyboard with the value on the button, and the user can change the value by tapping the button, and then I will present a list of values in a UIPopover in a ContainerView.

First, is this the best design pattern.

Second, can someone point me in the right direction for accomplishing this? I just can't seem to get the pieces to work.

I am thinking that maybe I do not need the Container View, just the UIPopover.

Any help would be greatly appreciated!

Bryan


Solution

  • I suggest using a UITableViewController in a popover. The table contains all the valid options in the appropriate order. When the user taps (selects) a row in the table, invoke a delegate method that passes the selected option, sets the button text, and dismisses the popover.