I am working on a directory listing application. Specifically, the app I am working on is called iEngineering. It would probably be best to drive home the purpose of my question if you download or look at the application on the AppStore. It is available for free. I would like to use one view controller with a table view to navigate to a similar view controller with table view. For example, selecting “Chemical Engineering” transitions/segues to a new screen with a new listing that displays sub categories within chemical engineering. Currently, my project requires two view controllers with table views for this process but I would like to condense it down into one single view controller with table view. Thank you all for your time and any guidance you may be able to offer me :)
Asked
Active
Viewed 37 times
0
-
`Any suggestions on topics to research or linkable sources to read/watch is all that I am after.`. These type of questions aren't allowed on Stack Overflow. Please read the [help] to understand the guidelines of the site before posting. – Charlie Fish Dec 27 '18 at 23:15
1 Answers
0
You only need the firstVC with a datasource array for the table , then when you select a category , instantiate a vc from that vc and send the array to it something like this
Inside ( didSelectRowAt
) of that SameVC
let vc = self.storyboard.,,,,,,, as! SameVC
vc.arr = arr.subCategory // set the sub to the new table
self.navigationController?.push///// // push not segue
Sure you will check if there is a content inside arr.subCategory
before doing this as there will be leaf categories
Note: arr and subCategory are of same data type as it's a nested process

Shehata Gamal
- 98,760
- 8
- 65
- 87
-
Oh quick question, what is meant by “leaf categories”? Is that the same thing as sub directories? – Tony Pendleton Dec 27 '18 at 23:43
-
1
-
So the leaf categories are the screens on my application with text field(s), correct? Sorry, I just want to be clear. – Tony Pendleton Jan 02 '19 at 01:54