F
F
Flie2014-09-02 11:45:42
Cocoa
Flie, 2014-09-02 11:45:42

How to make a menu from a table view with an arbitrary number of submenu transitions?

Good afternoon!
I have an idea to create a list of menu items on a UITableView. By clicking on the cell, a transition to the submenu should be made, also from the UITableView and so on. The depth of the submenu is not known in advance and varies during the process.
I started doing this: I created a TableViewController for the root menu in the storyboard, and from it through segue for the first-level menu, and then I realized that the number of such transitions is not known in advance. Help solve this problem. Maybe there are some patterns for such problems or is it possible to create a controller and a segway programmatically (if so, how?) Or is it generally solved in a different way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2015-04-05
@DaskOFF

do not use the storyboard at this stage, create the first table in the storyboard, and then programmatically.
Handle clicking on the cell, according to your data, see if you need to go further or not, if necessary, then create a new ViewController, pass the necessary data there and push it to the navigationController hierarchy, and repeat this procedure

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question