+ All Categories
Home > Documents > First class

First class

Date post: 14-Apr-2017
Category:
Upload: itea4you
View: 133 times
Download: 0 times
Share this document with a friend
40
IOSDEV: FIRST CLASS Pavel Žák
Transcript

IOSDEV: FIRST CLASSPavel Žák

–Pavel Žák

„Kéž bych tohle slyšel před 4 lety“

CO NÁS ČEKÁ?• Motivace

• Jak se stát iOS Developerem?

• Vývoj pro iOS a jeho specifika

• Architektura aplikace

• Obrazovky a UI

• Best practices

• Čtení na doma

IOSÁCI“celebs” mezi programátory?

IOS VS ANDROID• nízká fragmentace

• rychlá adopce nových verzí iOS

• optimalizovaný HW

• vyšší produktivita

• vyšší požadavky uživatelů

• “performance nazis”

ZAČÍNÁME

• účet na https://developer.apple.com/

• xCode

• mac/vm/hackintosh (http://www.tonymacx86.com)

• (ios zařízení)

ALTERNATIVY

• JetBrains AppCode

• Xamarin.iOS (25$/m)

• RoboVM (19$/m)

• PhoneGap

• (Unity3D)

REFERENCE DO ZAČÁTKU

• Developer docs: https://developer.apple.com/library/ios/navigation/

• RoadMapiOS: https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/

• tutoriály na http://www.raywenderlich.com

ARCHITEKTURACocoa Touch

Media

Core Services

Core OS Filesystem, Networking, Security, Bluetooth

ARCHITEKTURACocoa Touch

Media

Core Services

Core OS

CoreData, CoreLocation, CoreMotion, Foundation,

CFNetwork, NewsstandKit, Webkit, QuickLook…

ARCHITEKTURACocoa Touch

Media

Core Services

Core OS

AVFoundation, CoreAudio, CoreImage, CoreText, GLKit,

MediaPLayer, Photos, QuartzCore, SpriteKit,…

ARCHITEKTURACocoa Touch

Media

Core Services

Core OS

UIKit, EventKit, MapKit, NotificationCenter, Social, …

MVCA.K.A MASSIVE VIEWCONTROLLER

Model View

Controller

UI akceupdatenotifikace

Model View

Controller

UI akceupdatenotifikace

Model View

Controller

UI akceupdatenotifikace

Model View

Controller

UI akceupdatenotifikace

ANATOMIE UI

• Stromová hierarchie views

• 1 obrazovka ~ 1 controller

• View controller containment

UIView

UIImage

UILabel UIButton

ViewController

UIView

čudl

obrázek

popisek

PODTŘÍDY UIVIEWUIControl UIButton

UIPicker

UISlider

UISwitch

UITextfield

UIScrollView UITableView

UITextView

UICollectionView

UIImageView

UILabel

UIStepper

UIWebView

MKMapView

UIProgressView

UIActivityView

UIView

UIVIEW FRAME

• struktura CGRect

• origin & size

• relativně k superview

• neplést s Bounds!

• attr BOOL clipsToBounds

view

subview 1

subview2

TVORBA LAYOUTU/UI

• kód vs Interface Builder

• “fixní” vs autolayout

UIVIEW• BackgroundColor

• Atributy Hidden vs Alpha

• Touch events vs Gesture recognizers

• Motion events

• Animace (pozice, transformace, pozadí, alpha)

• CALayer

DEMO

VIEW LIFECYCLE

LoadView

ViewDidLoad ViewWillAppear

ViewDidAppear

ViewWillDisappear

ViewDidDisappear

požadavek na zobrazení View

požadavek na skrytí View

DidReceiveMemoryWarning

REAKCE NA UDÁLOSTI• Target-Action

• Delegace

• Zprávy přes NSNotificationCenter

• Key-value observing

• (callback blocks)

TARGET-ACTION

UIControl

Target: myViewControllerAction: buttonPressed:

myViewController

UIControlEventTouchUpInside

- (void) buttonPressed:(id)sender

DEMO

DELEGACE

aObject

delegate: myViewController

myViewController

- - aObject:DidSomething:- - aObject:ShouldDoSomething:

aObject:ShouldDoSomething:

YES

aObject:DidSomething:

NSNOTIFICATIONCENTER

NSNotificationCenter

anyObject otherObject

addObserver postNotification

observer1 observer2 observer3

SCROLLVIEW

UIScrollViewContent

ContentOffset

ContentSize

DEMO

TABULKY

UITableView

UITableViewCell

UITableViewCell

UITableViewDataSource

2numberOfSectionsInTableView:

tableView:numberOfRowsInSection:5

tableView:cellForRowAtIndexPath:UITableViewCell

TABULKY

UITableView

UITableViewCell

UITableViewCell

UITableViewDelegate

60tableView:heightForRowAtIndexPath:

tableView:viewForHeaderInSection:UIView

tableView:didSelectRowAtIndexPath:

DEMO

DOPORUČENÍ K UI

• žádná zbytečná loga

• konzistence

• jednoznačnost

• obsah

• výkon

• čtěte HIG

PERSISTENCE DAT• NSUserDefaults

• plists

• filesystem

• sqlite

• CoreData

DISTRIBUCE APLIKACE

• BundleId

• Vývojářský certifikát

• Provision profile

• AdHoc vs AppStore

• Testflight

A CO DÁL ?

• Samostudium

• Navazující přednášky

• Konzultace

[email protected]

Je to na vás!

ODKAZY

• Architektura iOS: https://developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/iPhoneOSTechOverview/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007898-CH1-SW1

• HIG: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/

• Videa z WWDC: https://developer.apple.com/videos/wwdc/2014/


Recommended