Programming iOS - Developing Applications for iPhone and iPad

1/8/2014 - 3/12/2014

If you are a developer who wants to write applications that run on the iPhone or iPad, you should attend this class.

In 10 evenings, Programming iOS will teach you to create iOS applications like the ones you use on your iPhone every day. The class focus is on solid iOS Programming fundamentals which will serve you well in any context.

After an introduction to the Objective-C language and the Foundation framework, we look in depth at the tools and the Classes that make up the iOS UI framework. We draw on the screen using UIKit, Core Graphics and Core Animation. We cover multi-touch event handling and the setup and configuration of a server in the cloud at AWS (Amazon Web Services) to support backend components of iOS applications. Your class assignments will interact with this server in a practical and real-world manner.

This course can be taught onsite for your company. Dave has taught this class for Shopzilla.com, LiveNation/TicketMaster, and many other smaller companies and individuals.



Lecture 10 - CoreMotion, MapKit, SpriteKit - 3/12/2014

In the last lecture of the course we cover device hardware: Compass, Accelerometer, Gyro. The Core Location and Core Motion API are covered in this context.

We will also cover the new SpriteKit API as a means to create 2D games on iOs devices.

Finally, we will decommision our dedicated AWS server that has feed json to our app so well.


Homework 10: Class Review, GPS and MapKit (Optional and involved, but highly recommended)

  • Create a UITabController-based application
  • On Tab 1, display raw GPS and Accelerometer data onto labels on the screen.
  • On Tab 2, display a UITableView with one row for each of your favorite restaurants. When a restaurant is selected, push a MapKit view onto the screen, showing your current location and the location of the restaurant.


Lecture 9 - Integrating Video and HTML5 into your application - 3/5/2014

In this lecture we wrap up our multimedia discussion by integrating video into an application using MPMovePlayerController.

See Example_Video.zip for an example of playing an .mp4 video file from the app bundle.

If you will stream video to the iPhone or iPad over cellular networks, you are required to send the video in HTTP Live Streaming (HLS) format. See the HTTP Live Streaming link as a starting point.

In class we demonstrate delivering both .mp4 data and HLS data from Amazon Web Services.

We cover including HTML5/CSS/javascript content (including video) into iOS applications.


Homework 9: Video and HTML5

  • Record a video of something G-Rated and interesting.
  • Encode the video to .mp4 format using Handbrake.
  • Create a tab-based application with two tabs
  • Include the video in both tabs, one tab using MPMoviePlayerController and the other tab using HTML5 video tag in the HTML displayed by UIWebView
  • Bonus extra credit: encode your video into an HLS stream, and deliver it from an S3 bucket.


Lecture 8 - Multithreading and Internet Resource Access - 2/26/2014

In this lecture we continued to investigate accessing Internet resources. Downloading data from the Internet tends to be slow and unreliable, so it is generally best to perform this operation on a background thread.

This can be accomplished in a number of ways, including starting up and managing your own threads, using NSOperationsQueue or with the newer Grand Central Dispatch API that uses the "blocks" language feature of Objective-C.

See Day8Demo1Internet below for a contrast between blocking code and code using Grand Central Dispatch to download a 3MB image from the Internet.


Homework 8: Parsing a document from a web server asynchronously
In this project you will improve a previous project by downloading slow Internet data on a background thread.

  • Add a UITableView to an iphone application
  • Download the JSON document from our class AWS Server, this time on a separate thread
  • Parse the JSON into an NSArray of NSDictionary objects
  • Use the array as a datasource for the UITableView by notifying the UITableView to reload when the data is ready


Lecture 7 - Internet Resources - 2/19/2014

iOS applications often have to download text or binary data from webservers. This data might contain the HTML for web pages, but more often contains data in the form of JSON, XML, or any other arbitray format as needed.

In this lecture, an AWS server instance was created from scratch and Apache, MySql and PHP installed. A simplistic JSON data feed was setup to deliver data from the MySql database to an iphone app at:

http://uclademo.certifiednetworks.com/jsonservice.php.

The simple php page reads rows from a MYSQL database and produces JSON in the following format:

[{"StudentID":"1","StudentEmail":"joe@nowhere.com"},{"StudentID":"2","StudentEmail":"sally@nowhere.com"},{"StudentID":"3","StudentEmail":"kim@fmail.com"}]


See jsonservice.php.zip below for the php code.


Homework 7: Parsing a document from a web server
  • Add a UITableView to an iphone application
  • Download the JSON document from our class AWS Server
  • Parse the JSON into an NSArray of NSDictionary objects
  • Use the array as a datasource for the UITableView


Lecture 6 - More Custom View Drawing, Animation - 2/12/2014

In this lecture, we continue to look at drawing custom UIView objects using Core Graphics.

A number of animation techniques are introduced, including:
  • UIImageView animation
  • Using NSTimer to schedule a recurring method with affects UIView objects
  • Core Animation

Behind every UIView is at least one CALayer object, which helps support the built-in and custom animations.


Homework 6: Custom Animation
Place a custom UIView on the screen which draws a shape such as a star or a heart, and make the view squash and bounce cartoon style when touched.

Lecture 5 - Files, Custom View Drawing - 2/5/2014

In this lecture, we review UIViewControllers and cover drawing custom UIView objects using Core Graphics.

Working with files from the local drive and downloaded from urls is introduced.


Homework 5: Custom View Drawing
Create an ipad application that reads an XML file from the bundle and displays 5 custom views on your screen.

Each custom view should display either a circle or a square of a certain size, color and location on the screen as indicated in the contents of the xml document.

See RSSReader.zip for an example of reading an XML File.

Lecture 4 - Controllers of UIViewControllers - 1/29/2014

In this lecture, we reviewed delegation and UITableViewControllers. UITabBarController and UINavigationController were demonstrated.


Homework 4: UITabBarController
In this lab, you will investigate UITabBarController, which contains an array of UIViewControllers. The UITabBarController manages the display of the .view property of each UIViewController held on each tab.
  • Create an iphone or ipad application using the "Empty Application" template.
  • In application: didFinishLaunchingWithOptions:, setup the UITabBarController with three tabs, and make it the rootViewController of the .window object
  • In the first tab, implement a UINavigationContoller that holds a UITableView. Slide in a detail screen when a row is clicked.
  • On the second tab, display a scrollable UIImageView with a world map that is larger than the physical screen on the device.
  • On the third tab, display a UIWebView implemented as the .view property of a custom UIViewController


As a tip to help you complete the lab, consider implementing each UIViewController in a small application independently. Add that UIViewController to the UITabBar application after it is complete and working properly.

For example, make a simple view-based app with a scrollable image. After it is working properly, drop that UIViewController into the final tab based application.

Don't forget to investigate the UIScrollViewDelegate protocol.


Lecture 3 - Delegation and UITableView - 1/22/2014

In this lecture, we discuss the delegation design pattern. Here is a link to the Apple docs that discuss delegation in Cocoa: Delegation.

To summarize delegation, an object delegates the responsibility to handle an event to some other object it has a reference to.

Silly example to illustrate: if you had an office assistant (delegate) and you hear the phone ring (event) you might ask your assistant to answer the phone, then forget about the call and move on with other tasks. If something important came up during the call, your assistant might let you know (notification).

Events, delegates, and notifcations in iOS work in the same manner. You will often find that a user interface object becomes much more re-usable if it defines a delegate or a datasource by using a protocol.

UITableView is a great example of delegation. The UITableView object asks its delegate for just about every aspect of its data and its behavior. The UITableViewDelegate and UITableViewDataSource protocols define the set of methods that a UITableView object will be calling on its delegate.

In this video a basic UITableView is demonstrated.
http://git.certifiednetworks.com/videos/iphone/Day3_TableView.mp4 17.2MB 9:34



Homework 3: Table View
  • Create an iphone application using the view-based template
  • Place a UITableView onto the screen, and populate it with the contents of an NSArray.



Lecture 2 - Objective-C Continued, UIViews and specialized UIViews - 1/15/2014

In this lecture, more Objective-C language elements and UIView class properties are covered.

The UIView class was covered in detail, and some specialized UIView objects were introduced as examples.

UIView concepts to review:
  • CGRect structure and CGRectMake() macro
  • UIView properties: .center, .frame, .alpha, .backgroundcolor
  • Affine transforms on a UIView: rotate, scale, translate
  • UIView animation blocks
  • UIView display hierarchy
  • UIResponder base class of UIView that provides touch and motion events


In class we created a few projects covering UIViews, including Day2Demo2 which demonstrates most of the things you will need to know about UIViews


Homework 2: UIViews and specialized UIViews
  • Create an iphone application using the view-based template.
  • Make a UIView object appear on the screen when the screen is touched
  • Zip up the project folder and email it to Dave.


Lecture 1 - iPhone/iPad Platform and Objective-C - 1/8/2014

In this lecture, a sample application named 'beginning-iphone-development' is created to introduce the Objective-C language and its basic elements.

Objective-C is an programming language that features extensions of the ANSI C language. These extensions that have been added are mostly centered around object-oriented programming: creating Classes and working with methods on the Classes.

The following Objective-C syntax extensions should be reviewed:
  • @interface
  • @implementation
  • @property
  • [ ] (square brackets)
  • #import
  • - (minus sign to mark an instance method)
  • + (plus sign to mark an class method)
  • @"Hello, World" - shortcut to create an instance of an NSString class


Homework 1: Contact Info, Setting Up Your Development Environment, Basic App
  • Send an email to Dave at dhenson@certifiednetworks.com with iOS in the subject line. This is important so your email address can be whitelisted.
  • Install the current production version of XCode - Version 5.0. This will likely need to be updated before our class is over.
  • Create an iphone application using the "empty application" template.
  • Display a red UIView object on the screen.
  • Zip up the project folder and email it to Dave.
Video: Homework 1 - Getting Started


Back to Top

XCode Projects - Class Demos, Examples and Homework Answers

Slides

Class Logistics

Previous Versions of iPhone and iPad iOS Development class

External Links

home Site Map Terms of Use Privacy Policy Client Directories