Slide 1

Slide 1 text

iOS 8 iPhone Developer Conference 2014 Tobias Conradi @toco91

Slide 2

Slide 2 text

Topics • Overview over new technologies • Adaptive UI • Improvements in Interface Builder

Slide 3

Slide 3 text

–developer.apple.com/ios8 „iOS 8 includes over 4,000 new APIs…“

Slide 4

Slide 4 text

App Extensions Action Custom
 Keyboard Document
 Provider Photo
 Editing Sharing Today

Slide 5

Slide 5 text

Today App Extensions

Slide 6

Slide 6 text

App Extensions Touch ID Action

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

HealthKit

Slide 9

Slide 9 text

Many new Frameworks App Extensions Touch ID Apple Pay PhotoKit HealthKit HomeKit CloudKit Handoff Manual Camera Controls Metal SceneKit

Slide 10

Slide 10 text

Adaptive UI

Slide 11

Slide 11 text

Fragmentation of Screen Sizes (in Points) Device Portrait Landscape iPhone 3.5“ 320 x 480 480 x 320 iPad 768 x 1024 1024 x 768 iPhone 4" 320 x 568 568 x 320 iPhone 4.7" 375 x 667 667 x 375 iPhone 5.5" 414 × 736 736 x 414

Slide 12

Slide 12 text

Adaptive UI • Fragmentation of Screen Sizes • Multiple Orientations • In Theory: Support for Unannounced Devices

Slide 13

Slide 13 text

Think of Size Classes instead of Sizes

Slide 14

Slide 14 text

Size Class • Abstract Size of the Interface • Regular • Compact • Unspecified

Slide 15

Slide 15 text

Size Classes Compact Any Regular Compact Any Vertical Regular Horizontal

Slide 16

Slide 16 text

Size Classes Compact Any Regular Compact 3.5", 4", 4.7" iPhone L 5.5“ iPhone L Any Vertical Regular all iPhone P iPad P & L Horizontal P = Portrait, L = Landscape

Slide 17

Slide 17 text

Size Classes Compact Any Regular Compact 3.5", 4", 4.7" iPhone L all iPhone L 5.5“ iPhone L Any 3.5", 4", 4.7" iPhone P & L 5.5“ iPhone P all devices all orientations 5.5“ iPhone L iPad P & L Vertical Regular all iPhone P all iPhone P iPad P & L iPad P & L Horizontal P = Portrait, L = Landscape

Slide 18

Slide 18 text

Demo SizeClasses in IB

Slide 19

Slide 19 text

UITraitCollection Properties: • Horizontal Size Class • Vertical Size Class • Display Scale • Interface Idiom -containsTraitsInCollection: +traitCollectionWithTraitsFromCollections:

Slide 20

Slide 20 text

Contains Traits in Collection? horizontal Compact vertical Regular scale 2.0 idiom Phone horizontal Compact vertical (Unspecified) scale (Unspecified) idiom (Unspecified) +traitCollectionWithHorizontalSizeClass: -containsTraitsInCollection: ✓

Slide 21

Slide 21 text

Contains Traits in Collection? horizontal Compact vertical Regular scale 2.0 idiom Phone horizontal Regular vertical (Unspecified) scale (Unspecified) idiom (Unspecified) +traitCollectionWithHorizontalSizeClass: -containsTraitsInCollection: ❌

Slide 22

Slide 22 text

Combining Trait Collections horizontal Compact vertical (Unspecified) scale (Unspecified) idiom Phone + horizontal Regular vertical Compact scale (Unspecified) idiom (Unspecified) horizontal Regular vertical Compact scale (Unspecified) idiom Phone = +traitCollectionWithTraitsFromCollections: Last Collection Wins

Slide 23

Slide 23 text

Trait Environments UIScreen

Slide 24

Slide 24 text

Trait Environments UIScreen UIWindow

Slide 25

Slide 25 text

Trait Environments UIScreen UIWindow UIViewController

Slide 26

Slide 26 text

Trait Environments UIScreen UIWindow UIViewController UIView

Slide 27

Slide 27 text

Trait Environments UIScreen UIWindow UIViewController UIView

Slide 28

Slide 28 text

Trait Environment • Protocol: -traitCollection -traitCollectionDidChange: • UIScreen • UIView • UIViewController • UIPresentationController

Slide 29

Slide 29 text

Traits and View Controller -willTransitionToTraitCollection:
 withTransitionCoordinator: -setOverrideTraitCollection:
 forChildViewController:

Slide 30

Slide 30 text

UIAppearance +appearanceForTraitCollection: +appearanceForTraitCollection:
 whenContainedIn:

Slide 31

Slide 31 text

Asset Catalog • Any • Any & Compact • Any & Regular • Additionally Device Specific

Slide 32

Slide 32 text

UIImage +imageNamed:
 inBundle:
 compatibleWithTraitCollection:

Slide 33

Slide 33 text

View Controller Changes

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Showing View Controllers -showViewController:animated: -showDetailViewController:animated: -targetViewControllerForAction:sender: -canPerformAction:withSender: //NO for opt-out • can be implemented by custom containers

Slide 36

Slide 36 text

Demo Presentation Controllers

Slide 37

Slide 37 text

Presenting View Controllers • -presentViewController:animated:completion: • New Styles: • UIModalPresentationOverFullScreen • UIModalPresentationOverCurrentContext • UIModalPresentationPopover

Slide 38

Slide 38 text

Presenting View Controllers New Properties: UIPresentationController *presentationController UIPopoverPresentationController *popoverPresentationController

Slide 39

Slide 39 text

Presentation Controller • Decoupling of Presentation and Animation • Provided by Presented View Controller • Delegates for Adaptivity • You Can Write Your Own Presentation Controllers

Slide 40

Slide 40 text

Demo IBDesignable/IBInspectable

Slide 41

Slide 41 text

Interface Builder • Add custom Attributes for IB • IBInspectable / @IBInspectable • Live preview in IB • IB_DESIGNABLE / @IBDesignable

Slide 42

Slide 42 text

Summary • Exciting new API • Traits and Size Classes • View Controller Changes • Interface Builder

Slide 43

Slide 43 text

@toco91 github.com/toco/IPDC-14/ github.com/toco/Designables