Development Primitives for iOS - Huber Flores
Transcript of Development Primitives for iOS - Huber Flores
MTAT.03.262 Mobile Application Development
Development Primitives for iOS
Huber Flores [email protected]
Tartu, Estonia, 2013 1
Outline
• Background
• iOS platform
– Requirements
– Technological specifications
• (architecture, programing models, etc.)
• Demo
Huber Flores 2
BACKGROUND
Huber Flores 3
What is iOS?
• Apple’s OS for iPhone – Launched 2007
– Core applications and services
• Direct manipulation concept – Multi-touch gestures (swipe, tap, pinch, and
reverse pinch)
• Application model based on online store (App store)
• Integration with iCloud (e.g. Siri, iTunes)
Huber Flores 4
iOS Architecture
Huber Flores
Physical layer
- Sensors Proximity, accelerometer, gyroscope, etc.
- Display
- CPU, memory, processors
- Network communication
- Battery
and so on… 5
iOS Architecture
Huber Flores
Core OS
- OS X Kernel
- Sockets
- Security
- Bonjour
- Certifications
- Power management
- BSD
6
iOS Architecture
Huber Flores
Core services
- Collections
- Address book
- Core location
- Threading
- SQLite
- Networking
- File access
- URL utilities 7
iOS Architecture
Huber Flores
Media
- Core audio
- Open AL
- Audio mixing
- Audio recording
- Video playback
- Core animation
- OpenGL ES
8
iOS Architecture
Huber Flores
Cocoa touch
- UIKit
- Foundation framework
9
iOS Architecture
Huber Flores
iCloud
- SyncML iTunes, etc.
- Web services
10
DEVELOPMENT PRIMITIVES
Huber Flores 11
Getting Acquaintance
• Mac OS X
• iPhone
• Apple developer ID
– Commercialization, service integration (e.g. Apple store, APNS)
• Xcode SDK
– Objective-C
Huber Flores 12
Xcode
• IDE for iOS development
– Design
– Implementation
– Execution (e.g. Device simulator)
– Debug
– Source code managment
– Documentation
Huber Flores 13
Xcode
Huber Flores 14
Xcode
Huber Flores 15
What is Objective-C
• ANSI C (superset)
• Enriches the language with OO capabilities
and more… (Dynamic binding and typing, etc.)
• GNU C
– Compiles both (C and Objective-C)
Huber Flores 16
Objective-C
• Objective-C
– iPhone
– Mac
• Java
– Almost everywhere… (with some tricks)
Huber Flores 17
Objective-C
• Message syntax
– Java:
myString.toString();
– Objective-C:
[myString description]
Huber Flores 18
Objective-C
• Method arguments
– Java:
Person.setFirstName("Raul");
– Objective-C:
[Person setFirstName:@"Raul"];
Huber Flores 19
Objective-C
• Object data types
– Java:
Person id = new Person();
– Objective-C:
Person *id = [[Person alloc] init];
Objetive-C also offers generic object type declaration
Huber Flores 20
Objective-C
• Libraries, packages and namespaces
– Java:
java.lang.String gender = new String("Male");
– Objective-C:
NSString *gender = [[NSString alloc]
initWithString:"Male"];
Huber Flores 21
Objective-C
• Methods – Java: public void setName(String firstName, String surName){…
– Objective-C: - (void) setName:(NSString *)firstName
lastName:(NSString *)surName
Call:
setName:lastName
Huber Flores 22
Objective-C
• Classes – Declared in .h file
– Implemented in .m file
• Compiler directives – @interface…. @end
– @implementation … @end
• Braces scope – Instance variable section inside curly braces
– Method defined outside curly braces
Huber Flores 23
Objective-C
• Class (Java)
Huber Flores 24
Objective-C
• Class
(declaration)
Huber Flores 25
Objective-C
• Class
(implementation)
Huber Flores 26
Basic Development Primitives
• Action
• Outlet
• Object binding
Huber Flores 27
QUESTIONS
Huber Flores 29