Getting Started with Custom UIControls

In the previous chapter, you set up the outlets for the Restaurant Detail screen and configured RestaurantDetailViewController so that it manages them. Next, you added methods to viewDidLoad() to populate the table view when the Restaurant Detail screen is displayed. Finally, you passed the appropriate RestaurantItem instance from RestaurantListViewController and MapViewController to RestaurantDetailViewController. RestaurantDetailViewController now displays data from that RestaurantItem on the Restaurant Detail screen.

At this point, the app has data in all of its screens, but the Restaurant Detail screen is incomplete. You can't set a star rating for a restaurant, and you can't save photos and reviews.

So far, you have been using Apple's standard UI objects. In this chapter, you will learn how to build a custom user interface object of the UIControl type that displays restaurant ratings in the form of stars. You'll also learn about using literals in your code and responding to touch events. Finally, you'll implement a review form that users can use to write restaurant reviews.

By the end of this chapter, you'll have a good grasp of how to create custom UIControl objects for your own apps. You'll also learn how to implement a review form.

The following topics will be covered in this chapter:

  • Creating a custom UIControl object
  • Displaying stars in your custom UIControl object
  • Adding support for touch events
  • Implementing an unwind method for the Cancel button
  • Creating ReviewFormViewController

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.141.6