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

53
Introduction to Apple iOS development Nikita Korchagin

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

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

Introduction to Apple iOS development

Nikita Korchagin

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

Introduction to Apple Platforms development

Nikita KorchaginApple platforms engineer

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

Developer

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

Developer

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

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

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

iOS History: from past to present

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

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

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

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

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

2009 - iPhone OS 3•Lots of UI & functionality

improvements (100+)

•Spotlight search

•Push notifications

•In-app purchase

•Core Data

•«Find my iPhone» functionality

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

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

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

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

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

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

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

June 2012 - WWDC - iOS 6

•Apple Maps

•Collection views

•AutoLayout

•Facebook integration

•Passbook

•New App Store

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

June 2013 - WWDC - iOS 7

•iOS redesigned (flat UI, no skeuomorphism)

• iTunes Radio

•Multitasking improvements

•New application switcher

•Filters for camera

•Automatic applications’ updates

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

June 2014 - WWDC - iOS8

•No significant design changes

•Multiple screen resolutions

•HomeKit and HealthKit, Metal

•Continuity

•Energy consumption by apps

•Swift programming language

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

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)*

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

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

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

How to start to develop for iOS?

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

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++

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

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

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

Objective-C

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

•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

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

•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

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

Swift

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

• 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

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

•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

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

Desktop vs. Mobile

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

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

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

Network•Variants of connection

•GPRS

•EDGE

•3G/4G

•WiFi

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

•Cellular network connection is expensive

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

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

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

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

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

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

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

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

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

Human Interface Guidelines

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

HIG

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

HIG

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

HIG

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

HIG

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

Bad UI/UX

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

Bad UI/UX

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

Bad UI/UX

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

Bad UI/UX

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

Tablets specific UI

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

Accessibility

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

Good UI/UX

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

Interface Builder HIG support

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

flat UI vs. skeuomorphism

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

Further steps

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

Q&A

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

Thanks for your attention!