iOS Development
Introduction
Gonzalo Parra
Friday 22 October 2010
Background
Friday 22 October 2010
iOS?
• iPod Touch
• iPhone
• iPad
Friday 22 October 2010
What is the iPhone?
• accelerometer
• gyroscophe
• GPS
• Digital compass
• multi-touch display
• sensors (proximity, ambient light)
• camera (photos, video)
• UMTS/HSDPA, GSM/EDGE,WI-FI, Bluetooth
Friday 22 October 2010
What is the iPhone?
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Core OS
OSX Kernel
Mach 3.0
BSD
Sockets
Security
Power Management
Keychain Access
Certificates
File System
Bonjour
iOS
Cocoa Touch
Media
Core Services
Core OS
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Core Services
Collections
Address Book
Networking
File Access
SQLite
Core Location
Net Services
Threading
Preferences
URL Utilities
iOS
Cocoa Touch
Media
Core Services
Core OS
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Media
Core Audio
OpenAL
Audio Mixing
Audio Recording
Video Playback
JPEG, PNG, TIFF
PDF
Quartz (2D)
Core Animation
OpenGL ES
iOS
Cocoa Touch
Media
Core Services
Core OS
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Cocoa Touch
Multi-Touch
Core Motion
View Hierarchy
Localization
Controls
Alerts
Web View
Map Kit
Image Picker
Camera
iOS
Cocoa Touch
Media
Core Services
Core OS
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Basics
Friday 22 October 2010
Components
• iOS SDK (requires an Intel Mac)
• Frameworks: Foundation, UIKit,...
• MVC
• Language: Objective-C
• Tools: XCode, Interface Builder, iPhone
Simulator, Instruments
• Apple Developer Program
Friday 22 October 2010
MVC
St
C
Fa
Controller
MVC
Model View
It’s all about managing communication between camps
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MVC: Controller
St
C
Fal
Controller
MVC
Model View
outlet
Controllers can also talk directly to their View.
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MVC:View
St
C
Fal
Controller
MVC
Model View
action
delegate
outlet
data
source
should
will did
target
count
data
at
No. The Model is (should be) UI independent.
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MVC: Model
St
C
Fal
Controller
MVC
Model View
action
Notification
& KVO
delegate
outlet
data
source
should
will did
target
count
data
at
Now combine MVC groups to make complicated programs ...
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MVCsMVCs working together
Stanford
CS193p
Fall 2010
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone!
Friday 22 October 2010
Hello iPhone!
• Tools
• XCode
• Interface Builder
Friday 22 October 2010
Hello iPhone MVC
Sta
CS
Fall
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
myButtonPushed
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone MVC
Sta
CS
Fall
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
HelloiPhoneViewController
myButtonPushed
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone MVC
Sta
CS
Fall
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
HelloiPhoneViewController
UILabel
myButtonPushed
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone MVC
Sta
CS
Fall
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
HelloiPhoneViewController
UILabel UIButton
myButtonPushed
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone MVC
Sta
CS
Fall
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
HelloiPhoneViewController
UILabel UIButton
myButtonPushed
UISlider
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone MVC
Sta
CS
Fall
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
HelloiPhoneViewController
UILabel UIButton
myButtonPushed
X UISlider
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Hello iPhone!
Hands-on
Friday 22 October 2010
Calculator
• http://bit.ly/iphonecalculator
Friday 22 October 2010
MapApp (MapKit)
Friday 22 October 2010
MapApp (MapKit)
Friday 22 October 2010
Extra material
• http://developer.apple.com/iphone/
• WWW
Friday 22 October 2010
Code
• HelloiPhone: http://bit.ly/helloiphonecode
• Calculator: http://bit.ly/mume10calc
• MapApp: http://bit.ly/mume10map
Friday 22 October 2010
References
• CS193P: Developing Applications for iOS, Stanford
University: http://cs193p.stanford.edu/
• HelloWorld Tutorial: http://bit.ly/helloiphone
• iPhone Programming Tutorial: http://bit.ly/crwpk0
• The Spoken Word: http://bit.ly/dcMXBK
Friday 22 October 2010

iOS Development Introduction