ios development introduction (mume11)

38
IOS DEVELOPMENT INTRODUCTION Gonzalo Parra #mume11 October 14, 2011

Upload: gonzalo-parra

Post on 22-Apr-2015

6.434 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: iOS Development Introduction (MuMe11)

IOS DEVELOPMENTINTRODUCTION

Gonzalo Parra#mume11

October 14, 2011

Page 2: iOS Development Introduction (MuMe11)

A smartphone is a mobile phone that offers more advanced computing

ability and connectivity than a contemporary feature phone.

Source: LP33.TV

Page 3: iOS Development Introduction (MuMe11)

WHAT IS THE IPHONE?• accelerometer

• Three-axis gyro

• Assisted GPS

• Digital compass

• multi-touch display

• sensors (proximity, ambient light)

• camera (photos, video)

• UMTS/HSDPA, GSM/EDGE, WI-FI, Bluetooth

Page 4: iOS Development Introduction (MuMe11)

Sources: http://www.trendbird.co.kr/, iOS Developer Library, http://www.capsulecomputers.com.au

Page 5: iOS Development Introduction (MuMe11)

IOS?

• iPod Touch

• iPhone

• iPad

Page 6: iOS Development Introduction (MuMe11)

WHAT IS THE IOS?

Based on a work at cs193p.stanford.edu

Page 7: iOS Development Introduction (MuMe11)

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

Page 8: iOS Development Introduction (MuMe11)

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

Page 9: iOS Development Introduction (MuMe11)

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

Page 10: iOS Development Introduction (MuMe11)

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

Page 11: iOS Development Introduction (MuMe11)

TYPES OF DEVELOPMENT

• Native Apps

• Mobile Web Apps

• External frameworks

Page 12: iOS Development Introduction (MuMe11)

NATIVE APPLICATIONS

• iOS SDK (requires an Intel Mac)

• Language: Objective-C

• Tools: XCode, iOS Simulator

• Apple Developer Program

• AppStore

Page 13: iOS Development Introduction (MuMe11)

EXAMPLES

Page 14: iOS Development Introduction (MuMe11)

MOBILE WEB APPLICATIONS

• Language: HTML*, Javascript, CSS

• Frameworks: Sencha Touch, jQueryMobile, ...

• Tools: HTML* editor (DashCode), iOS Simulator, Safari

• Can be displayed in “every” smartphone

* PHP, JSP, ASP, ...

Page 15: iOS Development Introduction (MuMe11)

EXAMPLESiUi: iPhone User Interface Framework

Page 16: iOS Development Introduction (MuMe11)

EXTERNAL PLATFORMS

• PhoneGap, Titanium,...

• requires iPhone SDK

• Language: HTML, Javascript, CSS

Page 17: iOS Development Introduction (MuMe11)

NATIVE APPS DEVELOPMENT:BASICS

Page 18: iOS Development Introduction (MuMe11)

COMPONENTS

• iOS SDK (requires an Intel Mac)

• Frameworks: Foundation, UIKit,...

• MVC

• Language: Objective-C

• Tools: XCode, iOS Simulator, Instruments

• Apple Developer Program

Page 19: iOS Development Introduction (MuMe11)

MVC

StanfordCS193p

Fall 2010

Controller

MVC

Model View

It’s all about managing communication between camps Based on a work at cs193p.stanford.edu

Page 20: iOS Development Introduction (MuMe11)

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

Page 21: iOS Development Introduction (MuMe11)

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

Page 22: iOS Development Introduction (MuMe11)

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

Page 23: iOS Development Introduction (MuMe11)

MVCMVCs working together

StanfordCS193p

Fall 2010

Based on a work at cs193p.stanford.edu

Page 24: iOS Development Introduction (MuMe11)

OBJECTIVE-C

.h .m

Interface Implementation

Page 25: iOS Development Introduction (MuMe11)

CLASSES

From: “The Objective-C Programming Language”

Page 26: iOS Development Introduction (MuMe11)

METHODS

[myArray insertObject:anObject atIndex:0]; From: “The Objective-C Programming Language”

Page 27: iOS Development Introduction (MuMe11)

PROPERTIES

@property BOOL flag;

@property (copy) NSString *nameObject;

@synthesize flag;

@synthesize nameObject;

From: “The Objective-C Programming Language”

Page 28: iOS Development Introduction (MuMe11)

HELLO IPHONE!

Page 29: iOS Development Introduction (MuMe11)

HELLO IPHONE!

Page 30: iOS Development Introduction (MuMe11)

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

Page 31: iOS Development Introduction (MuMe11)

HELLO IPHONE!:HANDS-ON

Page 32: iOS Development Introduction (MuMe11)

CALCULATOR• http://bit.ly/iphonecalculator

Page 33: iOS Development Introduction (MuMe11)

MVC

Page 34: iOS Development Introduction (MuMe11)

MAPAPP (MAPKIT)

Page 35: iOS Development Introduction (MuMe11)

EXTRA MATERIAL

• http://developer.apple.com/devcenter/ios/index.action

• WWW

Page 36: iOS Development Introduction (MuMe11)

CODE

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

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

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

Page 38: iOS Development Introduction (MuMe11)

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

• The Objective-C Programming Language: http://bit.ly/objcpl