Challenges

1. Add code that displays something when there are no cars. It can be as simple as the kind of label shown in the Contacts app. One approach is to include a view that you show or hide based on a condition. Also note that the user could delete the last car. The quickest way to test your code is to remove the initial car generated by CarTableViewController in viewDidLoad.

2. Add the ability to edit the fuel. You could do this using a new editor, or you could modify the Make/Model editor to work with numbers as well as text. If you take this approach, you need to add a configuration to specify text versus numbers and change what keyboard is brought up. You also need to add another current edit type so view car can do the right thing ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.