“Because tech is coded, so made means made. Made doesn’t mean funded or managed. Like a shirt that’s designed/licensed/funded in USA, and made in China: It’s Made in China, not Made in USA. Made means made.”—
iPad’s Mail uses a UITableView hierarchy as the master view in a UISplitView. There are a number of subtle behaviors worth noting if you want to copy this style.
Scroll position is saved for each mailbox; if you return to the same mailbox, you’ll be at the same scroll offset. Unless a row was selected but scrolled out of view when you left; then the table will be scrolled just enough to bring the selected row back into view.
Here’s where Apple really shines: if the selected row was scrolled off the top, it appears at the very top of the UITableView. If it was scrolled off the bottom, it appears at the very bottom.
scrollToNearestSelectedRowAtScrollPosition:animated: to the rescue. Specify UITableViewScrollPositionNone. This gives us exactly the right behavior:
The table view scrolls the row of interest to be fully visible with a minimum of movement. If the row is already fully visible, no scrolling occurs.
In portrait orientation when you select a new message, the table popover doesn’t immediately disappear. There’s a short delay (about 0.3 seconds feels right) before the popover is dismissed.
You could use performSelector:withObject:afterDelay:, but with Obj-C blocks there’s an even cleaner way:
If you’re in landscape orientation, entering a new mailbox automatically selects the first message in that mailbox.
In portrait orientation, if you navigate into a different mailbox the first message is not automatically selected. What’s more, if you dismiss the popover without selecting a message in the new mailbox and then re-open the popover, be ready for deja vu—you’re right back in the original mailbox. Your navigation state is lost unless you select a message. Interesting!
This last behavior is not trivial to implement, but it’s what makes Mail such a joy to use. You never get lost.
Yay! Just discovered Adam’s on Tumblr! And this post is evocative of @marcoarment’s writing and observations that I love!