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.


Lecture 12 - iCloud, Analytics, HTML5 and Other Alternative Development Environments

In this lecture we cover iCloud and things to consider while using this API. We cover the role of analytics, and take a look at developing your app through HTML5 and other alternative development environments.

Thanks for a great class. Let me know when your apps are out there!


Lecture 11 - Accelerometer and Gyro

In this lecture we cover the accelerometer, gyro and the Core Motion API.


Homework 11: Core Motion

Optional homework: place a view on the screen that moves in response to the accelerometer. Place five views at random places on the screen. If the moving view intersects with the random views, play a sound.

Lecture 10 - Network connections, sockets and GameKit

In this lecture we cover networking from the iOS environment. We look at sockets programming, revisit NSURLConnection, and cover the GameKit classes.


Homework 10: GameKit and Sockets

Option 1: Write an application that communicates with another device over GameKit. When you type a message into a UITextField, that message is displayed on the screen of the other device. In honor of Apple censorship, replace the letters of any objectionable word with symbols.

Option 2: Write an application that communicates through a socket to Node.js running on your mac. Anything that is typed into a UITextField is displayed onto the screen of any other device connected to the same socket.

Lecture 9 - Concurrency, multi-threading, JSON

In this lecture we investigated blocks, concurrency/multithreading, and JSON.

See Stuck.zip and Example_JSON.zip for examples.


Homework 9: JSON and Concurrency

Interact with at least one public JSON-based API. Make sure the JSON data transfer is on a background thread, not blocking the UI.

Lecture 8 - Audio and Video

In this lecture we will place a minor scratch in a very large suface of the the topic of audio and video on iOS.

Here are a couple of links to get you started:

Apple: Audio & Video Starting Point

Apple: Using Audio - multimedia programming guide

TSLibrary - open source media library access framework

FMOD Ex Programmers API Commercial well established sound engine that supports iOS.

Stormy Productions Commercial Radio API. Static library, $100.00 per app, free trial runs 10 minutes per session

Apple WWDC Videos Searchable set of videos on many technical topics, including audio and video iOs development.



Homework 8: Audio and Video

No specific homework assignment is required this week. It is recommended that you download and experiment with Audio_MixTest.zip to see how audio session setup works, Example_AVAudio.zip for playback and recording, and the nifty ConcertRecorder.zip application for recording using AVAudioRecorder.

Lecture 7 - Animation

In this lecture we wrapped up our discussion of UINavigationController by demonstrating a UITableView controller at the root of the hierarchy. See NavDemoWithTableView.zip.

Core Animation was discussed, including the layer property of every UIView object. CABasicAnimation and CAKeyframeAnimation classes were introduced and discussed.

A project called CALayerAnimTest.zip was downloaded an anlyzed from http://nachbaur.com/blog/core-animation-part-3 ...(see the bottom of the page for the XCode project download)

and Core-Animation-Demos from Bob McCune was also demonstrated: https://github.com/bobmccune/Core-Animation-Demos .


Homework 7: Animation

Create an iPad application. Add at least two views. Animate the views using at least one CABasicAnimation and one CAKeyframeAnimation. See AnimationHomework.zip for some ideas and sample code. Experiment with the types of animation that can be performed, play with the parameters, and investigate the properties of CALayer.

Lecture 6 - UIViewController, UINavigationController, UITabController

In this lecture, we covered the benefits of using UIViewControllers to handle the views on screen UINavigationController and UITabController classes are built to switch between UIViewController views.

UINavigationController is demonstrated in this XCode project from class: NavigationDemo-UCLA201202.zip
and UITabController is demonstrated in this XCode project from class: TabDemo-UCLA201202.zip .






Homework 6: View Controllers

Create an iPhone application with three tab views. In the first tab view, house a UINavigation Controller with at least two levels of hierarchy. Display a specilized view in the other two tabs, such as a UIWebView or a UIScroll view.

Lecture 5 - files, documents directory, and SQLite

In this lecture, the following techniques were covered for persisting data: text files, NSUserDefaults, Object Archiving, and SQLite database.

Some of these techniques are demonstrated in this demo from class: files-tutorial-UCLA-201202.zip .






Homework 5: Data Persistence

Create an iPhone application. Add at least two text UITextViews to the screen. Save what the user types into the text boxes when the application is closed. The data should reload into the views when the application is opened again.

Possible techniques to use: saving to a text file, NSUserDefaults, object archiving, and saving a row to a SQLite database. You may want to try out all four techniques.

Lecture 4 - More UITableView and delegation

In this lecture, delegation was discussed in more detail. A homebrew delegate property was built from scratch in the sample delegate-tutorial-ios-UCLA-201202.zip .

UITableView was discussed in more detail, particularly recycling the UITableViewCell rather than building a new one with Alloc/Init each time. Custom UITableViewCell objects were shown to be just specialized UIView objects that can be customized like any other UIView.




Specialized UIView objects are abundant in UIKit. We looked at some of the properties of UIImageView and UIScrollView in the ios-tableview-tutorial-UCLA-201202.zip demo, and how some of these views can be used in custom UITableViewCell objects.







This link to the Ray Wenderlich site has been both really helpful in completing specific tasks as well as an inspiration for app ideas. Check it out:
http://www.raywenderlich.com/tutorials


Homework 4: Customizing UITableView

The purpose of this homework assignment is to gain more practice working with UITableView and UITableViewCell objects. Understanding of these concepts will be fundamental to many(most?) applications on iPhone and iPad.

Create an iPhone application. Add a UITableView to the screen that displays data you have stored as NSDictionary objects in an NSArray. Subclass UITableViewCell, and add custom views to the cell that best display the NSDictionary objects found in your array.



Lecture 3 - Foundation Classes, drawing to the screen, delegation introduction

In this lecture, Foundation classes are covered in more detail. The design patterns of delegation that allows objects to communicate with each other was discussed. The delegate design pattern is demonstrated through implementation of a basic UITableView object.

This link to the Cocoa Fundamentals Guide at developer.apple.com is largely targeted to the Mac platform. It is a nice overview of the communication mechanisms found in Cocoa:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithObjects.html

George sent me this link to a youtube video showing some shortcuts in Interface Builder:
http://www.youtube.com/watch?v=ORy8hwXress&feature=plcp&context=C3c0e342UDOEgsToPDskK5VMsUoGDiEwsIodGSDYce

Many of the concepts from lecture 3 are revisited in the video covering UITableView below.
http://s3.amazonaws.com/certifiednetworks/video/iphone-sdk/ios-editable-uitableview-tutorial.mp4 1024x768 78MB 14:58



Homework 3: Investigating delegation and the UITableView

The purpose of this homework assignment is to gain more practice working with Objective-C and the Foundation classes. Additionally, it will help you to become more familiar with delegation and the UITableView class. Hopefully you will have fun with the assignment and will experiment outside of the homework requirements, for example by adding a custom view to the UITableviewCell or by changing the appearance of the cell. This one could take up some time as some of the concepts may be unfamiliar.

Create an iPhone or iPad application using either the window-based or the view-based template. Add a UITableView to the screen that displays data you have stored in an NSArray. After you get it working, use the appropriate delegate method to change the height of each UITableViewCell to be 100 points. This assignment will take some time, but will be a foundation for many iphone projects. See the EditableTableView.zip xcode project for a good example of the elements required.



Lecture 2 - Objective-C, Foundation Classes and UIViews

In this lecture, Objective-C concepts were reviewed. Foundation classes such as NSString were discussed. The UIView runtime hierarchy was demonstrated.

UCLA_Day2_Demo201201 project was created during class to demonstrate placing UIViews onto the screen.









Homework 2: UIViews
Create an iPad application with three UIViews overlapping one another. Set the alpha property of the views such that the view on the bottom is still visible. Try completing the project both in code and with Interface Builder.



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 was introduced.

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

The following Objective-C extensions that are discussed and should be reviewed: @interface, @class, @property, [] (square brackets), #import, - (minus sign to mark an instance method), + (plus sign to mark an instance method).

UCLA_Day1_Demo project was created during class to demonstrate some of these concepts. See the readme.txt file in the iOS project for more information.









Homework 1: Getting Started
Send me an email with iOS in the subject line.
Read 'Learning Objective-C: A Primer' from Apple listed below.
Install the iOS SDK and XCode.
Create an iphone application using the view-based template. Display "Hello, World." on an instance of a UILabel. See UCLA_2012_HelloWorld.zip for a completed solution to the homework assignment.

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

Slides

Class Logistics

Previous Versions of iPhone and iPad iOS Development class

home Site Map Terms of Use Privacy Policy Client Directories