ios dev intro

38
IOS DEVELOPMENT INTRODUCTION Gonzalo Parra #mume12 October 5, 2012

Upload: gonzalo-parra

Post on 24-Apr-2015

731 views

Category:

Documents


1 download

DESCRIPTION

iOS intro for the Multimedia course at KU Leuven

TRANSCRIPT

Page 1: iOS Dev Intro

IOS DEVELOPMENTINTRODUCTION

Gonzalo Parra#mume12

October 5, 2012

Page 2: iOS Dev Intro

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 Dev Intro

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 Dev Intro

IOS?• iPod Touch

• iPhone

• iPad

Page 5: iOS Dev Intro

WHAT IS THE IOS?

Based on a work at cs193p.stanford.edu

Page 6: iOS Dev Intro

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 7: iOS Dev Intro

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 8: iOS Dev Intro

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 9: iOS Dev Intro

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 10: iOS Dev Intro

TYPES OF DEVELOPMENT

• Native Apps

• Mobile Web Apps

• External frameworks

Page 11: iOS Dev Intro

NATIVE APPLICATIONS

• iOS SDK (requires an Intel Mac)

• Language: Objective-C

• Tools: XCode

• Apple Developer Program

• AppStore

Page 12: iOS Dev Intro

EXAMPLES

Page 13: iOS Dev Intro

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

Page 14: iOS Dev Intro

EXAMPLESiUi: iPhone User Interface Framework

Page 15: iOS Dev Intro

EXTERNAL PLATFORMS

• PhoneGap, Titanium,...

• requires iOS SDK

• Language: HTML, Javascript, CSS

Page 16: iOS Dev Intro

NATIVE APPS DEVELOPMENT:BASICS

Page 17: iOS Dev Intro

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

Page 18: iOS Dev Intro

MVCModel View Controller

Page 19: iOS Dev Intro

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 Dev Intro

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 Dev Intro

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 Dev Intro

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 Dev Intro

MVCMVCs working together

StanfordCS193p

Fall 2010

Based on a work at cs193p.stanford.edu

Page 24: iOS Dev Intro

OBJECTIVE-C

Page 25: iOS Dev Intro

OBJECTIVE-C

.h

Interface

.m

Implementation

Page 26: iOS Dev Intro

CLASSES

From: “The Objective-C Programming Language”

Page 27: iOS Dev Intro

METHODS

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

Page 28: iOS Dev Intro

PROPERTIES

@property BOOL flag;

@property (nonatomic) NSString *nameObject;

@synthesize flag = _flag;

@synthesize nameObject = _nameObject;

From: “The Objective-C Programming Language”

.h

.m

Page 29: iOS Dev Intro

HELLO IPHONE!

Page 30: iOS Dev Intro

HELLO IPHONE!

Page 31: iOS Dev Intro

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 32: iOS Dev Intro

HELLO IPHONE!:HANDS-ON

Page 33: iOS Dev Intro

CALCULATOR

http://bit.ly/iphonecalculator

Page 34: iOS Dev Intro

MVC

Page 35: iOS Dev Intro

EXTRA MATERIAL

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

• WWW

Page 36: iOS Dev Intro

CODE

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

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

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

Page 37: iOS Dev Intro

THANKS!QUESTIONS?

@gaposx

Page 38: iOS Dev Intro

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