iOS Development Introduction

31
iOS Development Introduction Gonzalo Parra Friday 22 October 2010

description

iOS Development Introduction for MuMe10 course @ K.U.Leuven

Transcript of iOS Development Introduction

Page 1: iOS Development Introduction

iOS Development Introduction

Gonzalo Parra

Friday 22 October 2010

Page 2: iOS Development Introduction

Background

Friday 22 October 2010

Page 3: iOS Development Introduction

iOS?

• iPod Touch

• iPhone

• iPad

Friday 22 October 2010

Page 4: iOS Development Introduction

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

Page 5: iOS Development Introduction

What is the iPhone?

Based on a work at cs193p.stanford.edu

Friday 22 October 2010

Page 6: iOS Development Introduction

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

Page 7: iOS Development Introduction

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

Page 8: iOS Development Introduction

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

Page 9: iOS Development Introduction

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

Page 10: iOS Development Introduction

Basics

Friday 22 October 2010

Page 11: iOS Development Introduction

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

Page 12: iOS Development Introduction

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

Page 13: iOS Development Introduction

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

Page 14: iOS Development Introduction

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

Page 15: iOS Development Introduction

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

Page 16: iOS Development Introduction

MVCsMVCs working together

StanfordCS193p

Fall 2010

Based on a work at cs193p.stanford.edu

Friday 22 October 2010

Page 17: iOS Development Introduction

Hello iPhone!

Friday 22 October 2010

Page 18: iOS Development Introduction

Hello iPhone!

• Tools

• XCode

• Interface Builder

Friday 22 October 2010

Page 19: iOS Development Introduction

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

Page 20: iOS Development Introduction

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

Page 21: iOS Development Introduction

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

Page 22: iOS Development Introduction

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

Page 23: iOS Development Introduction

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

Page 24: iOS Development Introduction

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

Page 25: iOS Development Introduction

Hello iPhone!Hands-on

Friday 22 October 2010

Page 26: iOS Development Introduction

Calculator• http://bit.ly/iphonecalculator

Friday 22 October 2010

Page 27: iOS Development Introduction

MapApp (MapKit)

Friday 22 October 2010

Page 28: iOS Development Introduction

MapApp (MapKit)

Friday 22 October 2010

Page 29: iOS Development Introduction

Extra material

• http://developer.apple.com/iphone/

• WWW

Friday 22 October 2010

Page 30: iOS Development Introduction

Code

• HelloiPhone: http://bit.ly/helloiphonecode

• Calculator: http://bit.ly/mume10calc

• MapApp: http://bit.ly/mume10map

Friday 22 October 2010

Page 31: iOS Development Introduction

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