Date post: | 22-Apr-2015 |
Category: |
Documents |
Upload: | gonzalo-parra |
View: | 2,391 times |
Download: | 0 times |
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 OSOSX KernelMach 3.0BSDSocketsSecurity
Power ManagementKeychain AccessCertificatesFile SystemBonjour
iOSCocoa Touch
Media
Core Services
Core OS
StanfordCS193p
Fall 2010
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Core ServicesCollectionsAddress BookNetworkingFile AccessSQLite
Core LocationNet ServicesThreadingPreferencesURL Utilities
iOSCocoa Touch
Media
Core Services
Core OS
StanfordCS193p
Fall 2010
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MediaCore AudioOpenALAudio MixingAudio RecordingVideo Playback
JPEG, PNG, TIFFPDFQuartz (2D)Core AnimationOpenGL ES
iOSCocoa Touch
Media
Core Services
Core OS
StanfordCS193p
Fall 2010
Based on a work at cs193p.stanford.edu
Friday 22 October 2010
Cocoa TouchMulti-Touch
Core Motion
View Hierarchy
Localization
Controls
Alerts
Web View
Map Kit
Image Picker
Camera
iOSCocoa Touch
Media
Core Services
Core OS
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
Controller
MVC
Model View
action
delegateoutlet
data source
should
will did
target
countdataat
No. The Model is (should be) UI independent. Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MVC: Model
StanfordCS193p
Fall 2010
Controller
MVC
Model View
actionNotification
& KVO
delegateoutlet
data source
should
will did
target
countdataat
Now combine MVC groups to make complicated programs ... Based on a work at cs193p.stanford.edu
Friday 22 October 2010
MVCsMVCs working together
StanfordCS193p
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
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
StanfordCS193p
Fall 2010
Controller
MVC
Model View
action
outlet
target
Then hand out an action to the View.
HelloiPhoneViewController
UILabel UIButton
myButtonPushedX 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