简体   繁体   中英

XCode Storyboard and UIViewController instantiation

Good afternoon,

I have a storyboard configured but I have difficulty with one aspect.

I am using a UITableView to recreate a directory structure ie folder>subfolder>files. The structure is going to be different for every user and the structure is supplied via a API. I currently have a UITableViewController within the storyboard.

How can I recreate this in the storyboard?

Currently I am just recreating another instance of the UITableViewController class and pushing it on to the UINavigationController but I of course lose all of the assigned segues.

Thanks

I'd expect one scene to represent the folder hierarchy. It would be a single UITableViewController with a table with 2 prototype table view cells. One table view cell would be for folders, the other for files. The table cell for the folders would have a push segue leading back in a loop to the table view controller. The file segue would lead to what ever scene you uses for files.

You can to use the table view data source and delegate methods to drive the table view and fill it with instances of your prototype cells.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM