Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


GopiKrishna Saripuri
GopiKrishna Saripuri
1,123 Points

How to handle hierarchical master/details view in iOS using swift.

I've basic understanding/hands on with iOS development. I'm looking for tutorial/help with developing a master/detail application with hierarchical data, the flow is similar to the iPad settings app looks like,

I want to display the available categories in master view and if I select a particular category, on the detail view I want to display the list of available items, if I pick one item in the detail I want to display its details. Also looking to add support for adding new elements from the details view and edit/delete support. Could you help me with example or how to proceed.

1 Answer

Joshua Hardy
Joshua Hardy
17,204 Points

You could use buttons that have IBActions with the segue programmed to take the view from the master to the detail view. Have a button per view. This would only allow for the user to go from master -> detail. If the user wanted to go to another detail, then the user would have to go back to the master view first.

Or you could have a menu bar, which would allow the user to go from any view to any other view.