Course

Build a Blog Reader iPhone App

The Blog Reader app will teach us one of the most common and important needs when creating an app: downloading data from the Internet and displaying it in a list. We will investigate the Model-View-Controller design pattern (MVC) that is essential for all iPhone apps, learn how to request data from the web, parse and use information in JSON format, and utilize the built-in UITableViewController to display a list of blog post titles and thumbnails. We'll also see how to display a webpage inside our app.

Cover ios blog reader

6 Achievements

Exploring the Master-Detail Template

Exploring the Master-Detail Template

Xcode’s Master-Detail template makes it easy to create an app that displays a list view along with a detail view. We will look at all the code generated by the template and learn about table view controller, delegate and datasource.

Rebuilding from Scratch

Rebuilding from Scratch

Time to ditch the template code and recreate the master-detail app from scratch. Rebuilding allows us to learn the fundamental design pattern known as Model-View-Controller (MVC). In addition, we will learn about the view controller lifecycle and how to connect view elements on the storyboard to our code.

Show 6 Steps
Getting Data from the Web

Getting Data from the Web

Learn how data can be requested from a web service, parsed and then stored. We will learn how to access data in the JSON format which involves downloading and parsing it. Once parsed, the data needs to be stored in a collection object such as a dictionary.

Show 6 Steps
Data Modeling

Data Modeling

The advantage of object-oriented programming is the ability to model your data after real-world objects. Parsing the JSON data gave us a better understanding of its structure. We can now create a custom class to represent an individual blog post. The custom class will serve as a concrete representation of a blog post and will make our code manageable and readable.

Adapting Data for Display

Adapting Data for Display

The downloaded data needs to be neatly displayed in the table view. Each row will show the blog post title, author and thumbnail, which involves customizing the table view cell to accommodate all three elements.

Viewing a Web Page

Viewing a Web Page

Upon selecting a blog post from the list, the user is taken to a detail view where they can read the entire blog post. The blog post is simply a web page displayed with the help of a special view known as a web view of the class UIWebView.

Show 6 Steps

What you'll learn

  • Understanding the UITableViewController
  • Creating custom model objects
  • Customizing table view cells
  • Accessing JSON data from the web
  • Displaying a web page using UIWebView

Instructor

  • Amit Bijlani

    Amit is an iOS Developer who loves teaching and speaking about iOS. When not in front of a computer, he's exploring the outdoors or meditating. Find him on Twitter @paradoxed.

Download videos

You have to sign up for Treehouse in order to download course videos.

Sign up