Home > 2010 Fall DPS913 > DPS913 lecture notes Thu Oct 7

DPS913 lecture notes Thu Oct 7

Now that you know something about a navigation-based application, we will build on that by using a table view. You will learn a design and coding pattern that will make this style of app easy to create.


Prepare for today’s class

Digital content linked below, and on the virtual textbook page


Coming up in DPS913 / APD601

Mon Oct 11 – no class/lab (Thanksgiving Day statutory holiday)

Thu Oct 14 – Core Data technology introduction

Mon Oct 18 – probably Test 1

Thu Oct 21 – navigation-based app style that uses Core Data


The importance of design and coding patterns

Today’s theme is “navigation-based apps that use a table view”.

This kind of iOS app has many “moving parts”. As a result, you need to follow some design principles and coding patterns. Doing so will enable you to reliably and consistently create this style of app, with a predictable amount of effort. Additionally, your app will have good quality, and its components will be modular enough to enable reuse and replication.

Today, and in the next few lectures, you will learn about these design principles and coding patterns:

  • A view controller should include all its required behaviour (an obvious “given”), and it should also have the data it needs to do its job
  • This means you create one or more properties to bear/hold the data it needs
  • Typically, its “parent” (in the navigation controller hierarchy) should provide/set the data (by setting the property)
  • When preparing to activate the “next level” view controller (and its view), you should always follow a predictable set of three steps: 1) create the view controller instance; 2) configure it;, and 3) push it onto the navigation stack

There are a few other principles, patterns, and practices that you will encounter – be on the lookout for them.


Selecting the right Xcode app template

In the previous lecture, we introduced the navigation-based app style. We used the Xcode “Window-based Application” template. That was appropriate for the situation, because you needed to learn about navigation as an atomic topic, before moving on to more complicated scenarios.

From now on, we will use the “Navigation-based Application” template. This template includes a root view controller, with a table view. All of the components are configured to work right away. When using the navigation-based app template, the coding pattern is simplified – there are only three tasks:

  1. Configure the “root” view controller
  2. Create the next level, by a) creating and configuring its view controller (and optionally its view), and b) configuring its “parent” view controller
  3. Repeat Step 2 for as many levels as you need


Example apps covered today

Nav Colors – introduction, a table view leads to an end point view controller

Nav SCS – multi-level navigation, with a few interesting features


Blog posts for today’s class

Introduction to a navigation-based app with a table view

Multi-level navigation-based apps


Categories: 2010 Fall DPS913
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: