iPhone and iPad SDK Programming Class

Programming the Apple iPhone and iPad devices using the IOS SDK can be challenging for beginners, but rewarding. This class covers a broad overview of iPhone and iPad programming, including a coverage of Objective-C, UIKit framework, and other frameworks needed for successful completion of iOS projects.

iOS Animation - Lecture 10

In this lecture, we will cover basic animation techniques available in the iOS SDK, including UIView animation blocks, Core Animation, UIImage animation introduced last week, and a full run loop created with a scheduled NSTimer and DrawRect method of a custom UIView class.

Homework 10: iOS animation
Create a basic game with tiles, each tile having a letter. The letters make up a word that is scrambled. The user will drag the tiles into squares at the bottom of the screen. If the user gets the word correct, it will move onto the next random scrambled word.

iOS Custom View Drawing with Core Graphics - Lecture 9

In this lecture we looked at using the DrawRect method of UIView as a way of drawing custom views.

A lengthy class demo (UCLASummer_CoreGraphicsDemo.zip) was presented that demonstrated a custom graph view which displayed custom graph items. The delegate model of the demonstration loosely followed the delegate model of UITableView. Integrating both Core Graphics custom drawing and integrating images (bar graph top and bar graph middle) were demonstrated. The demo project was cleaned up considerably before being posted.

You might want to read through the "view programming guive for iOS" at the Apple developer site. It provides nice coverage of view lifecycle topics, and toward the end of the document discusses implementing custom views:

Homework 9: Custom View Drawing
Create a view-based app the uses a custom view with a gradient in the background. Draw the gradient using core graphics. When the screen is touched, a view with a custom drawn polygon should be displayed at the CGPoint that was touched. Add a button to clear all the custom views off the screen so you can start over with a blank screen.

Bonus challenges: 1) Create your custom polygon view such that it can be initialized with a specific number of sides.

iOS Data Storage and UITableViews - Lecture 8

In this lecture we look at storing data on the device and at the UITableView object.

Homework 8: Files and UITableView
Create a view-based app that uses a file in the documents directory to support a UITableView. When an item is chosen, load a file for display on a detail screen.

iOS KVO/Delegation Wrap-up, View Controller-Controllers - Lecture 7

In this lecture we wrapped up our discussion of KVO (Key Value Observing) and delegation. We demonstrated a UITableView as an extreme example of delgation.

We wrapped up our discussion of UINavigationController objects and UITabController objects.

KVODemo.zip - demonstrates both KVO and NSNotificationCenter.

Homework 7: Wrap up and improve homework 6 - due 8/10/2011

Lecture 6 - UIControls and inter-class communication

In this lecture we looked at UIControl Class and some of it's subclasses. We discussed the four main mechanisms for inter-class communication in Objective-C: target/action, delegation, NSNotificationCenter, and KVO (Key Value Observing).

Most of our class time was spent on delegation and KVO.

Demos to look at are: UCLADelegateDemo.zip - demonstrates creating your own delegate, UCLASummer_TableViewDemo.zip demonstrates the delegate pattern from UITableView, UCLASummer_Class6Demo simple demo of target/action with a UIButton and Interface Builder.

Homework 6: UIControls and Delegation - due 8/10/2011
This is a challenging assignment that will require some time and thought.

Create an iphone application using the "view" based template. Create a custom model class that notifies a delegate of any changes. This will require defining a protocol. Set up a UITimer in the model class that increments a property of every time two minutes have elapsed.

Create two views on the screen that reflect the state of the model. In one view, use KVO to be notified of any changes in the model. In the other view, use delegation to be notified of the change.

Implement a custom control that also increments the model's property when you double-tap the control.

Bonus challenge: set up a third view that uses NSNotificationCenter to be notified of any changes in the model.

Lecture 5 - Even More UIView drawing

In this lecture we reviewed the function of the ApplicationDelegate, the UIViewController and the UIView classes. The process of troubleshooting was demonstrated by working through and fixing a Oscar's homework assignment. We discussed custom drawing with the drawRect method of a UIView class, and looked at some simple transformations that can be done to the CALayer that backs each UIView. We discussed the touch events that are often handled in the UIViewController class.

Demos to look at are Homework4_Oscar.zip and UCLA_Summer_WeekFiveDemo.zip.

iOS 5 is looming, this is a pretty decent summary on approximately what to expect:

Homework 5: Views and Touches
Create an iphone application using the "view" based template. Place a UIView in the center of the screen that always starts with a random rotation. When the view is touched, have the view complete a full rotation, ending back at it's starting rotation. Create an icon for your application using a graphics program such as Gimp.

Lecture 4 - More UIView drawing, UIViewControllers

In this lecture we reviewed the process that the iOS environment uses to load up an application: start with main.m, which passes to the appdelegate, which reads the info.plist file and tries to find the Main Window Nib entry. Typically MainWindow.xib file ties everything together. In class, we deleted MainWindow.xib file, deleted the entry in info.plist, and hooked everything up ourselves in the SimpleDemo example. This example was extended to include UIViewController objects which were placed into a UINavigationController hierarchy.

Homework 4: UViewController
Create an ipad application using the "window" based template. Add a UIViewController with a custom UIView for display on the screen.

A completed project for this assignment can be found below for reference.

Lecture 3 - Foundation framework and drawing to the screen

In this lecture we focused on drawing UIViews to the screen. We introduced target-action as a means for a UI element to communicate with it's view, regardless of the type of view or how the UI element might be used in the future. UIButton was used as an example of target-action.

Somehow we managed to get through an entire class without looking at one single slide.

Interface Builder was introduced, and it was demonstrated how IBOutlets are used to get a pointer to an object created in Interface Builder. This pointer can be used to read and write properties of the UI object. An IBAction is used to hook an event (such as touchUpInside) to a method that you have defined in your class.

Homework 3: Universal App With Two Views Added

Create a universal application (iphone and ipad) using the "Windows" based application template. Draw two views on the screen that overlap and that display on both the iPhone and iPad environment.

A completed project for this assignment and a video tutorial can be found below for reference.

Lecture 2 - Objective-C and Foundation framework

In this lecture details of Objective-C language were wrapped up and some of the foundation classes such as NSString and NSArray were introduced.

Homework 2: Install the iOS SDK and XCode. Create a new iphone application using the view-based template. Display a property from an instance of a custom class on the view, perhaps using an instance of UILabel.

Lecture 1 - iPhone/iPad Platform and Objective-C

In this lecture, the iOS Platform is introduced using the iPad and iPhone. The Objective-C language and its basic elements are introduced.

Objective-C is an extension of the ANSI C language. It has been extended to include certain features centered around object oriented programming.

Homework 1: Send me an email, Read 'Learning Objective-C: A Primer' Listed below.

Apple Documentation - Objective-C, A Primer. http://developer.apple.com/iphone/library/referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/

XCode Projects - Class Demos, Examples and Homework Answers


13.0MB, 05:35, 7/10/2011 - Demonstrates creating a universal app that displays two views. Walkthrough for the answer to homework 3.
23.7MB, 13:10, 7/6/2011 - Class demo using Interface Builder to set IBAction and IBOutlet links.
14.4MB, 06:05, 7/2/2011 - Demonstrates displaying a property from a custom class onto a view.


Class Logistics

Previous Versions of iPhone and iPad iOS Development class

home Site Map Terms of Use Privacy Policy Client Directories