DPS923 notes – Thu Jan 30

Quiz 2. Persistence introduction. Working with more than one view; alert, action sheet, modal views. Table view. Tab bar app style.

.

Quiz 2 is today

Quiz 2 is today. It will happen at the beginning of the timeslot. The procedure will be the same as the one followed last week.

.

Persistence introduction, using a ‘plist’

Your app can read and write to the file system of the iOS device.

Simple data persistence can be done with a “property list”, also known as a plist. It is typically an XML-based storage format, for certain kinds of objects. Strings, numbers, arrays, and dictionaries can easily be stored in a plist.

This document has complete coverage.

.

Working with more than one view, an introduction

In the early weeks of this DPS923 / MAP523 course, you have worked with iOS apps that have one single view. (Well, as you have learned, that view is a container, for sub-views that include buttons, text fields, segmented controls, and so on.)

Today, you will begin working with more than one view.

We’ll start with temporary views, on the iPhone form factor.

A temporary view has these characteristics:

  • covers all or part of the screen
  • interrupts the task flow of the application
  • requires user input before it can be dismissed.

The iOS Human Interface Guidelines document has brief discussions of temporary views, and modal contexts

Here are the temporary view choices that we’ll look at today:

  • Alert View
  • Action Sheet
  • Modal view, from a framework
  • Modal view, creating our own

Very important: All temporary views require a delegate.

.

Alert

An alert informs and gathers a response from the user. An alert appears centered on the screen.

We build it in code, in a controller.

You configure the controller to be the delegate of the UIAlertView object. The delegate method performs a task, based on the user’s response.

.

Action Sheet

Similar story…

An action sheet presents (typically) two or more buttons to gather a user’s response. An action sheet slides up from the bottom of the screen, modally.

We build it in code, in a controller.

You configure the controller to be the delegate of the UIActionSheet object. The delegate method performs a task, based on the user’s response.

.

Alert and Action Sheet Programming How-To Summary

Here’s a summary of the how-to-program tasks for an alert or action sheet:

1. In a controller, adopt the protocol, by editing the controller .h interface code

2. In a controller method, write code to create, configure, and present the alert or action sheet

3. Implement the delegate method to handle the user input

Study the “Alert Action” example app.

.

Modal view, from a framework

.

Modal view, creating our own

.

Table view introduction

.

Table view, modal, single-select

.

Table view, modal, multi-select

.

Tab bar app style

.

.

.

.

.

.

.

.

.

.

.

.

Advertisements
  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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: