ios dev intro

Post on 24-Apr-2015

737 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

iOS intro for the Multimedia course at KU Leuven

TRANSCRIPT

IOS DEVELOPMENTINTRODUCTION

Gonzalo Parra#mume12

October 5, 2012

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

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

• Apple Developer Program

• AppStore

EXAMPLES

MOBILE WEB APPLICATIONS

• Language: HTML*, Javascript, CSS

• Frameworks: Sencha Touch, jQueryMobile, ...

• Tools: HTML* editor (DashCode), Safari

• Can be displayed in “every” smartphone

* PHP, JSP, ASP, ...

EXAMPLESiUi: iPhone User Interface Framework

EXTERNAL PLATFORMS

• PhoneGap, Titanium,...

• requires iOS SDK

• Language: HTML, Javascript, CSS

NATIVE APPS DEVELOPMENT:BASICS

COMPONENTS

• iOS SDK (requires an Intel Mac)

• Frameworks: Foundation, UIKit, Core Data, Core ...

• Design strategy: MVC

• Language: Objective-C

• Tools: XCode (iOS Simulator), Instruments

• Apple Developer Program

MVCModel View Controller

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

OBJECTIVE-C

.h

Interface

.m

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 (nonatomic) NSString *nameObject;

@synthesize flag = _flag;

@synthesize nameObject = _nameObject;

From: “The Objective-C Programming Language”

.h

.m

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

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

THANKS!QUESTIONS?

@gaposx

REFERENCES

• CS193P: Developing Applications for iOS, Stanford University: http://cs193p.stanford.edu/

• HelloWorld Tutorial: http://bit.ly/helloiphone

• iPhone Programming Tutorials: http://bit.ly/crwpk0

• Learning Objective-C: A Primer: http://bit.ly/objcpl

top related