Chapter 9
Customize Table Views Using Prototype Cell

I think that's the single best piece of advice: Constantly think about how you could be doing things better and questioning yourself.

- Elon Musk, Tesla Motors

In the previous chapter, we created a simple table-based app to display a list of restaurants using the basic cell style. In this chapter, we'll customize the table cell and make it look more stylish. There are a number of changes and enhancements we are going to work on:

  • Rebuild the same app using UITableViewController instead of UITableView
  • Display a distinct image for each restaurant rather than showing the same thumbnail
  • Design a custom table view cell instead of using the basic style of table view cell

You may wonder why we need to rebuild the same app. There are always more than one way to do things. Previously, we used UITableView to create the table view. In this chapter, we'll use UITableViewController to create a table view app in Xcode. Will it be easier? Yes, it's going to be easier. Recalled that we needed to explicitly adopt both UITableViewDataSource and UITableViewDelegate protocols, UITableViewController has already adopted these protocols and established the connections for us. On top of this, it has all the required layout constraints right out of the box.

Starting from this chapter and onwards, you begin to develop a real-world app called FoodPin. It's gonna be fun!

To continue reading and access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.

results matching ""

    No results matching ""