O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling Changing of Section Groups

Changing the groups shown in sections requires two main changes: an interface for the user to change the grouping and the code to update the sort and sections.

The interface presents four options: Parked, Make, Model, and Year. Parked corresponds to the default order on dateCreated. Using a UISegmentedControl is a good way to present a small number of options. Follow these steps:

1. Open Main_iPhone.storyboard and find the car table view controller.

2. Drag in a UIView between the bottom of the navigation bar and the top of the table view (the first prototype cell). Set the background color of the view to Mercury, and then use the Size inspector to set the height to 30 points.

3. Drag a UISegmentedControl

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required