Mobile Application Development— iOS · Outline • Background of iOS • How to start...

28
MTAT.03.262 Mobile Application Development— iOS Presented by Chii Chang [email protected] http://math.ut.ee/~chang/

Transcript of Mobile Application Development— iOS · Outline • Background of iOS • How to start...

Page 1: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

MTAT.03.262

Mobile Application Development—

iOSPresented by Chii Chang

[email protected]://math.ut.ee/~chang/

Page 2: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Outline

• Background of iOS

• How to start iOS application development

• Major development concepts

– (problems a beginner may face)

• Examples

Chii Chang

Page 3: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

You might have seen

Chii Chang

http://en.wikipedia.org/wiki/Mobile_operating_system

Page 4: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Why iOS?

Chii Chang

Data source: https://www.netmarketshare.com (August 2014)

Mobile Web Browsing

Mobile Web Application

Page 5: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

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

Page 6: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

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

Page 7: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

ObjC vs. Swift - Class

Chii Chang

ObjC

.h

.m

Swift

.swiftHeader

Method

Page 8: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

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

Page 9: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Complier Environment Concept

Chii Chang

C++

ObjC

Swift

Java Virtual Machine

C

Page 10: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Swift has better performance

Chii Chang

Page 11: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Start Developing iOS App

What do you need?

• Mac OS 10.8+

• XCode IDE (iOS SDK included)

Chii Chang

Page 12: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Developer Program

Chii Chang

If you want to test your app on real device

Page 13: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

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

Page 14: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

XCode

Chii Chang

Page 15: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Main User Interface of Xcode

(Coding)

Chii Chang

Page 16: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Main User Interface of Xcode

(GUI Design)

Chii Chang

Page 17: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

iDevice Simulator

• Simulator ≠ Emulator

• Simulator:

– Share hardware resources

– Subset of current OS

– Fast

• Emulator:

– Virtual machine

– Different OS

– Slow

Chii Chang

iPhone 4S Simulator

Page 18: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Debug Interface

Chii Chang

Page 19: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Storyboard

Chii Chang

Page 20: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Project Settings – Rename Project

Chii Chang

DEMO…

Page 21: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Project Settings – Import Libraries

Chii Chang

Page 22: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Project Settings - Flag

• Example, using GDataXML (of Gdata API)

Chii Chang

Page 23: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Project Settings – Search Path

Chii Chang

Page 24: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Project Settings – Individual Class

Setting (disable ARC)

Chii Chang

Disable “Automatic Reference Counting (ARC)”

Page 25: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Automatic Reference Counting (ARC)

Chii Chang

http://blog.teamtreehouse.com/ios-5-automatic-reference-counting-arc

Page 26: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

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

Page 27: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Demo Applications-Simple Map App

-Simple Game

Chii Chang

Page 28: Mobile Application Development— iOS · Outline • Background of iOS • How to start iOSapplication development • Major development concepts – (problems a beginner may face)

Questions?

Chii Chang