iOS 8 IPDC

49f0cda85134c6aef960bf6a32f4e1c7?s=47 toco
November 17, 2014

iOS 8 IPDC

The talk I gave at the iPhone Developer Conference 2014 in Hamburg about new technologies in iOS 8.
Samplecode:
https://github.com/toco/IPDC-14/
https://github.com/toco/Designables

49f0cda85134c6aef960bf6a32f4e1c7?s=128

toco

November 17, 2014
Tweet

Transcript

  1. iOS 8 iPhone Developer Conference 2014 Tobias Conradi @toco91

  2. Topics • Overview over new technologies • Adaptive UI •

    Improvements in Interface Builder
  3. –developer.apple.com/ios8 „iOS 8 includes over 4,000 new APIs…“

  4. App Extensions Action Custom
 Keyboard Document
 Provider Photo
 Editing Sharing

    Today
  5. Today App Extensions

  6. App Extensions Touch ID Action

  7. None
  8. HealthKit

  9. Many new Frameworks App Extensions Touch ID Apple Pay PhotoKit

    HealthKit HomeKit CloudKit Handoff Manual Camera Controls Metal SceneKit
  10. Adaptive UI

  11. 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
  12. Adaptive UI • Fragmentation of Screen Sizes • Multiple Orientations

    • In Theory: Support for Unannounced Devices
  13. Think of Size Classes instead of Sizes

  14. Size Class • Abstract Size of the Interface • Regular

    • Compact • Unspecified
  15. Size Classes Compact Any Regular Compact Any Vertical Regular Horizontal

  16. 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
  17. 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
  18. Demo SizeClasses in IB

  19. UITraitCollection Properties: • Horizontal Size Class • Vertical Size Class

    • Display Scale • Interface Idiom -containsTraitsInCollection: +traitCollectionWithTraitsFromCollections:
  20. Contains Traits in Collection? horizontal Compact vertical Regular scale 2.0

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

    idiom Phone horizontal Regular vertical (Unspecified) scale (Unspecified) idiom (Unspecified) +traitCollectionWithHorizontalSizeClass: -containsTraitsInCollection: ❌
  22. 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
  23. Trait Environments UIScreen

  24. Trait Environments UIScreen UIWindow

  25. Trait Environments UIScreen UIWindow UIViewController

  26. Trait Environments UIScreen UIWindow UIViewController UIView

  27. Trait Environments UIScreen UIWindow UIViewController UIView

  28. Trait Environment • Protocol: -traitCollection -traitCollectionDidChange: • UIScreen • UIView

    • UIViewController • UIPresentationController
  29. Traits and View Controller -willTransitionToTraitCollection:
 withTransitionCoordinator: -setOverrideTraitCollection:
 forChildViewController:

  30. UIAppearance +appearanceForTraitCollection: +appearanceForTraitCollection:
 whenContainedIn:

  31. Asset Catalog • Any • Any & Compact • Any

    & Regular • Additionally Device Specific
  32. UIImage +imageNamed:
 inBundle:
 compatibleWithTraitCollection:

  33. View Controller Changes

  34. None
  35. Showing View Controllers -showViewController:animated: -showDetailViewController:animated: -targetViewControllerForAction:sender: -canPerformAction:withSender: //NO for opt-out

    • can be implemented by custom containers
  36. Demo Presentation Controllers

  37. Presenting View Controllers • -presentViewController:animated:completion: • New Styles: • UIModalPresentationOverFullScreen

    • UIModalPresentationOverCurrentContext • UIModalPresentationPopover
  38. Presenting View Controllers New Properties: UIPresentationController *presentationController UIPopoverPresentationController *popoverPresentationController

  39. Presentation Controller • Decoupling of Presentation and Animation • Provided

    by Presented View Controller • Delegates for Adaptivity • You Can Write Your Own Presentation Controllers
  40. Demo IBDesignable/IBInspectable

  41. Interface Builder • Add custom Attributes for IB • IBInspectable

    / @IBInspectable • Live preview in IB • IB_DESIGNABLE / @IBDesignable
  42. Summary • Exciting new API • Traits and Size Classes

    • View Controller Changes • Interface Builder
  43. @toco91 github.com/toco/IPDC-14/ github.com/toco/Designables