Mobile Application Development— iOS · Outline • Background of iOS • How to start...
Transcript of Mobile Application Development— iOS · Outline • Background of iOS • How to start...
MTAT.03.262
Mobile Application Development—
iOSPresented by Chii Chang
[email protected]://math.ut.ee/~chang/
Outline
• Background of iOS
• How to start iOS application development
• Major development concepts
– (problems a beginner may face)
• Examples
Chii Chang
You might have seen
Chii Chang
http://en.wikipedia.org/wiki/Mobile_operating_system
Why iOS?
Chii Chang
Data source: https://www.netmarketshare.com (August 2014)
Mobile Web Browsing
Mobile Web Application
What is iOS?
• Previously—iPhone OS
• Unix-based operating system.Subset of Mac OS X.
• Multi-touch graphical user interface
• Current version: iOS 7.x / iOS 8
• iDevices: iPod, iPod Touch, iPhone, iPad etc.
• Security reason; Applications run individually, cannot interact with each other (iOS 7-)
– i.e. You cannot run a cheating program to cheat the game you are playing
Chii Chang
Application Programming Language
• Objective-C and Swift
• Objective-C (ObjC) from NeXT OS (Unix system); core
programming language for Mac OS X
• Swift:
– New programming language starts from 2014 for iOS
– “Objective-C without C”
– More information:
• “The Swift Programming Language” (iBooks; free)
Chii Chang
ObjC vs. Swift - Class
Chii Chang
ObjC
.h
.m
Swift
.swiftHeader
Method
Java, ObjC, Swift
• Java
java.lang.String gender = new String( “Male” );
orjava.lang.String gender = “Male” ;
• Objective-C
NSString * gender = [[NSString alloc] initWithString: @“Male” ];
orNSString * gender = @”Male” ;
• Swift
let gender = “Male”
orvar gender = “Male”
orvar gender: String? = “Male”
Chii Chang
// Constant; Cannot be changed
// Can be changed
Complier Environment Concept
Chii Chang
C++
ObjC
Swift
Java Virtual Machine
C
Swift has better performance
Chii Chang
Start Developing iOS App
What do you need?
• Mac OS 10.8+
• XCode IDE (iOS SDK included)
Chii Chang
Developer Program
Chii Chang
If you want to test your app on real device
Alternative Development Environment
• http://xamarin.com/platform
• Previous Mono Touch
• C#
• Write once, deploy on Android, iOS, Windows Phone
• Still requires a Mac computer
Chii Chang
XCode
Chii Chang
Main User Interface of Xcode
(Coding)
Chii Chang
Main User Interface of Xcode
(GUI Design)
Chii Chang
iDevice Simulator
• Simulator ≠ Emulator
• Simulator:
– Share hardware resources
– Subset of current OS
– Fast
• Emulator:
– Virtual machine
– Different OS
– Slow
Chii Chang
iPhone 4S Simulator
Debug Interface
Chii Chang
Storyboard
Chii Chang
Project Settings – Rename Project
Chii Chang
DEMO…
Project Settings – Import Libraries
Chii Chang
Project Settings - Flag
• Example, using GDataXML (of Gdata API)
Chii Chang
Project Settings – Search Path
Chii Chang
Project Settings – Individual Class
Setting (disable ARC)
Chii Chang
Disable “Automatic Reference Counting (ARC)”
Automatic Reference Counting (ARC)
Chii Chang
http://blog.teamtreehouse.com/ios-5-automatic-reference-counting-arc
Interesting Frameworks
• Mobile Web Server: CocoaHTTPServer
https://github.com/robbiehanson/CocoaHTTPServer
• GData Objective-C Cient https://code.google.com/p/gdata-objectivec-
client/
• RESTKit https://github.com/RestKit/RestKit
• AFNetworking https://github.com/AFNetworking/AFNetworking
• Game Development
– Cocos2D: http://www.cocos2d-swift.org/
– Cocos3D: http://brenwill.com/cocos3d/
• SPiCa, mobile device cloud computing
by Mobile & Cloud Lab
Chii Chang
Demo Applications-Simple Map App
-Simple Game
Chii Chang
Questions?
Chii Chang