Никита Корчагин - Introduction to Apple iOS Development.

Post on 19-Feb-2017

229 views 0 download

Transcript of Никита Корчагин - Introduction to Apple iOS Development.

Introduction to Apple iOS development

Nikita Korchagin

Introduction to Apple Platforms development

Nikita KorchaginApple platforms engineer

Developer

Developer

Today•Introduction

•Brief history of iOS and Apple devices

•Starting iOS programming

• iOS development

•Desktop vs. Mobile: what’s different

•Human Interface Guidelines

•Further steps: materials to read

iOS History: from past to present

2007 - iPhone OS 1• Based on Darwin’s (XNU) kernel port

for ARM

• Multitouch screen

• Few standard applications

• iPhone 1st gen and iPod Touch 1st gen

• Web-based applications only

• No multitasking

• No SDK

• Usage of private APIs by third-party developers

2008 - iPhone OS 2

•Paid update (all further major and minor updates are free)

•First version of iPhone SDK

•Xcode IDE for iOS development

•App Store for iPhone and iPod Touch

•iPod Touch 2G released

2009 - iPhone OS 3•Lots of UI & functionality

improvements (100+)

•Spotlight search

•Push notifications

•In-app purchase

•Core Data

•«Find my iPhone» functionality

January 2010 - iPhone OS 3.2•iPad released

•iPhone OS SDK provides abilities to create universal applications

•iPad applications should support multiple device orientations

•iPad-only UI components - Split view controllers, windowed modal controllers, popover controllers

•Backward compatibility with iPhone applications

June 2010 - WWDC - iOS 4•iPhone OS became iOS

•iPhone 4 with Retina display

•Support of restricted multitasking

•Background execution of applications

•Blocks and Grand Central Dispatch

•Local notifications

•Game Center and Game Kit

June 2011 - WWDC - iOS 5•Wireless updates & sync

• iCloud

•Notification center

•Siri

•Containment API

•Automatic Reference Counting (ARC)

•Twitter integration out-of-box

•Newsstand API

•Core Image

June 2012 - WWDC - iOS 6

•Apple Maps

•Collection views

•AutoLayout

•Facebook integration

•Passbook

•New App Store

June 2013 - WWDC - iOS 7

•iOS redesigned (flat UI, no skeuomorphism)

• iTunes Radio

•Multitasking improvements

•New application switcher

•Filters for camera

•Automatic applications’ updates

June 2014 - WWDC - iOS8

•No significant design changes

•Multiple screen resolutions

•HomeKit and HealthKit, Metal

•Continuity

•Energy consumption by apps

•Swift programming language

June 2015 - WWDC - iOS9•Multitasking (Slide Over, Split View,

and Picture in Picture.)

•Search API

•GameplayKit, ReplayKit, Model I/O

•App Thinning

•Swift 2

•watchOS 2 (app extensions)*

June 2016 - WWDC - iOS10•SiriKit, CallKit, Messages extensions

•Proactive Suggestions

•Video Subscriber Account (SSO)

•Swift 3

•macOS Sierra

•watchOS 3

•tvOS (9 september 2015)*, UIKit/TVML

How to start to develop for iOS?

Jedi way•Intel-based Mac (Mac Mini, MacBook Air/Pro, iMac, Mac Pro)

• Installed macOS

•Xcode with latest iOS SDK

•Apple device (iPhone/iPod Touch/iPad/ watch/ TV)*

•Apple Developer program account ($99 per 1 year)*

•Good knowledge of design patterns

•Objective-C and Swift knowledge OR

•Relevant experience in C or any strong-typed object-oriented language like Java/C#/C++

Alternative ways•Alternative IDE - AppCode (Mac, still requires Xcode to

be installed)

•Objective-C++ (kernel - C++, UI - Objective-C)

•PhoneGap/Titanium (cross-platform)

•Xamarin (.NET/C# - compiles to native code)

•C++ Marmalade SDK for Visual Studio

•Unity3D/Cocos2D-x for game development

•HTML5/CSS3/JavaScript for web applications

Objective-C

•Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language.

•Originally developed in the early 1980s, it was selected as the main language used by NeXT for its NeXTSTEP operating system.

•Objective-C is a thin layer on top of C, and moreover is a strict superset of C.

Objective-C

•All of the syntax for non-object-oriented operations (including primitive variables, pre-processing, expressions, function declarations, and function calls) are identical to that of C.

•Syntax for object-oriented features is an implementation of Smalltalk-style messaging.

• It is the main programming language used by Apple until 2014.

•Still strong and alive…

Objective-C

Swift

• Swift is a multi-paradigm, compiled programming language created by Apple Inc. for iOS and OS X development.

• Swift was introduced at Apple's 2014 WWDC and Swift 3 at WWDC 2016.

• Initially a proprietary language, Swift 2 became open source supporting iOS, macOS, watchOS, tvOS, Linux, freeBSD, Raspberry Pi, Android and Windows.

• Swift supports the core concepts that made Obj-C flexible, notably dynamic dispatch, widespread late binding, extensible programming and similar features.

Swift

•It uses the Objective-C runtime, allowing C, Objective-C, C++ and Swift code to run within a single program.

• Swift has added the concept of protocol extensibility, an extensibility system that can be applied to types, structs and classes, Apple promotes this as a real change in programming paradigms they refer to as protocol-oriented programming.

•Going Server-side with Swift Open Source (#1 on GitHub)

• Swift@IBM Breaking down barriers between client and server all over the world (Kitura framework, Sandbox, Bluemix)

Swift

Desktop vs. Mobile

What’s different?•Multitouch display & gestures

•Front and rear camera

•Speakers and microphone

•Location subsystem - GPS/GLONASS

•Magnetometer and compass

•G-sensor and accelerometer

•Bluetooth accessories

Network•Variants of connection

•GPRS

•EDGE

•3G/4G

•WiFi

•All these opportunities (except WiFi) are connection-lost-prone

•Cellular network connection is expensive

Screens

•Fullscreen applications

•Bigger UI elements for fingers

•Dark colors to reduce energy consumption

•Different resolutions (x1, x2 and x3)

•Assets for different resolutions

•Ergonomics

Resources•Every heavy application dramatically drains battery’s life

•Geolocation - GPS

•Networking

•Disk capacity is limited (8/16/32/64/… GB and no SD/microSD slot)

•Restricted multitasking (full introduced in iOS 7)

•Only a few types of content are supported

•UI is rendered using real-time thread and shouldn’t be blocked ever

Security mechanisms•Sandboxing - every application is isolated and runs under

restricted user’s account («jailed»)

• IPC is limited to URL schemas and extensions

•Personal data and passwords should be encrypted (Keychain) or not stored on the device at all

•HTTPS connections are preferred*; certificate validation is needed

•Data on disk can be encrypted and protected by iOS

•Group policies can be established for iOS devices using configuration profiles

Creating and submitting the app

•Application should be tested thoroughly; crashes are forbidden

•Application should follow Apple’s Human Interface Guidelines

•Private API usage is forbidden

•Application can be deployed only to the device which is in the provisioning list

•Application’s binary is signed using developer’s private key

•Application is thoroughly tested during review process

Human Interface Guidelines

HIG

HIG

HIG

HIG

Bad UI/UX

Bad UI/UX

Bad UI/UX

Bad UI/UX

Tablets specific UI

Accessibility

Good UI/UX

Interface Builder HIG support

flat UI vs. skeuomorphism

Further steps

Q&A

Thanks for your attention!