Book Image

Application Development in iOS 7

By : Kyle Begeman
Book Image

Application Development in iOS 7

By: Kyle Begeman

Overview of this book

Table of Contents (15 chapters)
Application Development in iOS 7
About the Author
About the Reviewers

Custom cell

Before we start writing our code to display the data, we want to create a custom table view cell. With your project open, select File | New | File. Select Cocoa Touch as the base and select Objective-C Class before clicking on Next. We want this class to be a subclass of UITableViewCell. The cell will display food items, so let's give it the name FoodCell. Save this file and move it into our Custom Class group (if it is not already in it).

Now that we have our class, let's link it up to our storyboard. Open Main.storyboard and find the table view controller we had previously moved into the storyboard. After opening the Main.storyboard file, open the Utilities pane and select the Identity section. Make sure that this view controller's class has been set to MyFoodsViewController. Now select the blank table view cell and set its class to our newly created FoodCell class.

Building the cell

Now that our class is linked, we can build the cell in our storyboard. The cell itself will consist...