For the acani iPhone app, I’d like display groups (based on interests) in a UITableView. I’d like to organize the groups taxonomically, e.g.:
- Sports
- Bat-and-ball
- Baseball
- Softball
- Cricket
- Hockey
- Field Hockey
- Ice Hockey
- Roller Hockey
- Bat-and-ball
- Engineering
- Electrical Engineering
- Biochemical Engineering
How should I arrange this on a UITableView?
I’m thinking that there should be a root UITableView that will have the sections Sports & Engineering, and the cells Bat-and-ball & Hockey will be under the Sports section, and the cells Electrical Engineering & Biochemical Engineering will be under the Engineering section.
Then Bat-and-ball should have its own UITableView, which should have cells Baseball, Softball, and Cricket.
Does this sound like a good way to arrange the UI?
Do you have any sample code or links to Xcode sample code for a UI like this? There’s gotta be an Xcode sample project that does something like this. Perhaps the periodic table of elements project or Core Data Books?
Thanks!
Matt
You got it. A
UITableViewreally isn’t designed to show more than two levels of a hierarchy, as sections and rows. If you want to show more than two levels, a “drill-down” approach used in most (all?) iOS apps, where tapping a row presents anotherUITableViewon the navigation stack. (As you say.)There are lots of Apple sample code projects that use this design pattern.
Edit: just checked and DrillDownSave is a good example, as is SimpleDrillDown.