iOS Development Introduction (MuMe11)

Post on 22-Apr-2015

6,433 views 2 download

description

 

transcript

IOS DEVELOPMENTINTRODUCTION

Gonzalo Parra#mume11

October 14, 2011

A smartphone is a mobile phone that offers more advanced computing

ability and connectivity than a contemporary feature phone.

Source: LP33.TV

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

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

IOS?

• iPod Touch

• iPhone

• iPad

WHAT IS THE IOS?

Based on a work at cs193p.stanford.edu

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

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

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

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

TYPES OF DEVELOPMENT

• Native Apps

• Mobile Web Apps

• External frameworks

NATIVE APPLICATIONS

• iOS SDK (requires an Intel Mac)

• Language: Objective-C

• Tools: XCode, iOS Simulator

• Apple Developer Program

• AppStore

EXAMPLES

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, ...

EXAMPLESiUi: iPhone User Interface Framework

EXTERNAL PLATFORMS

• PhoneGap, Titanium,...

• requires iPhone SDK

• Language: HTML, Javascript, CSS

NATIVE APPS DEVELOPMENT:BASICS

COMPONENTS

• iOS SDK (requires an Intel Mac)

• Frameworks: Foundation, UIKit,...

• MVC

• Language: Objective-C

• Tools: XCode, iOS Simulator, Instruments

• Apple Developer Program

MVC

StanfordCS193p

Fall 2010

Controller

MVC

Model View

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

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

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

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

MVCMVCs working together

StanfordCS193p

Fall 2010

Based on a work at cs193p.stanford.edu

OBJECTIVE-C

.h .m

Interface Implementation

CLASSES

From: “The Objective-C Programming Language”

METHODS

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

PROPERTIES

@property BOOL flag;

@property (copy) NSString *nameObject;

@synthesize flag;

@synthesize nameObject;

From: “The Objective-C Programming Language”

HELLO IPHONE!

HELLO IPHONE!

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

HELLO IPHONE!:HANDS-ON

CALCULATOR• http://bit.ly/iphonecalculator

MVC

MAPAPP (MAPKIT)

EXTRA MATERIAL

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

• WWW

CODE

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

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

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

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