Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WWDC20 Recap of SwiftUI & Combine

kagemiku
July 21, 2020

WWDC20 Recap of SwiftUI & Combine

Event: https://mercari.connpass.com/event/180254/
Some demos and screenshots are hidden due to NDA of Apple Developer Program.

kagemiku

July 21, 2020
Tweet

More Decks by kagemiku

Other Decks in Technology

Transcript

  1. ABOUT ME ▸ kagemiku (Akira Fukunaga) ▸ GitHub: @kagemiku ▸

    Twitter: @kagemiku_en ▸ Software Engineer at Mercari JP ▸ Team: Client Architect ▸ Joined: April, 2019 (new grads) Last year
  2. RECAP OF SWIFTUI ▸ App structure ▸ List and Collections

    ▸ New Components and Effect ▸ Data Managements
  3. RECAP OF SWIFTUI ▸ App structure ▸ List and Collections

    ▸ New Components and Effect ▸ Data Managements
  4. APP STRUCTURE ▸ @main ▸ New attributes for indicating top-level

    entry point for program flow (Swift 5.3) ▸ detail: https://docs.swift.org/swift-book/ReferenceManual/ Attributes.html#ID626
  5. APP STRUCTURE ▸ App ▸ New protocol for representing the

    structure and behavior of an app. ▸ This protocol has `main` entry point
  6. ▸ Scene & WindowGroup ▸ iOS14 introduces App/Scene/View hierarchy in

    SwiftUI protocol APP STRUCTURE APP SCENE VIEW VIEW ↑ Independent State ↓
  7. RECAP OF SWIFTUI ▸ App structure ▸ List and Collections

    ▸ New Components and Effect ▸ Data Managements
  8. LIST AND COLLECTIONS ▸ LazyHStack & LazyVStack ▸ Finally, LazyStack

    is provided! ▸ Inside contents are initialized lazily BETA VERSION SCREENSHOT
  9. LIST AND COLLECTIONS ▸ LazyHGrid & LazyVGrid ▸ Finally, UI

    components like Collection are provided! BETA VERSION SCREENSHOT
  10. LIST AND COLLECTIONS ▸ LazyHGrid & LazyVGrid BETA VERSION SCREENSHOT

    BETA VERSION SCREENSHOT BETA VERSION SCREENSHOT
  11. RECAP OF SWIFTUI ▸ App structure ▸ List and Collections

    ▸ New Components and Effect ▸ Data Managements
  12. NEW COMPONENTS AND EFFECT ▸ Toolbar and Label ▸ You

    can put toolbar item with Label ( = Text + Image ) BETA VERSION SCREENSHOT
  13. NEW COMPONENTS AND EFFECT ▸ Link and openURL environment action

    ▸ Open external URL with default browser BETA VERSION SCREENSHOT
  14. RECAP OF SWIFTUI ▸ App structure ▸ List and Collections

    ▸ New Components and Effect ▸ Data Managements
  15. DATA MANAGEMENTS ▸ @StateObject ▸ New property wrapper for `ObservableObject`

    ▸ Creation and destruction is tied to the views life cycle @StateObject @ObservedObject created view is created struct is initialized destructed view is destructed struct is destructed
  16. DATA MANAGEMENTS ▸ @StateObject ▸ New property wrapper for `ObservableObject`

    ▸ Creation and destruction is tied to the views life cycle
  17. DATA MANAGEMENTS ▸ SceneStorage and AppStorage ▸ SceneStorage: Scene-scoped data

    storage ▸ AppStorage: App-scoped data storage (using UserDefaults)
  18. SUMMARY ▸ Recap of SwiftUI ▸ App protocol structure is

    renewed ▸ App -> Scene -> View ▸ AppStorage and SceneStorage for storing data ▸ Lazy stacks and Grid components are provided ▸ New property wrapper @StateObject is introduced ▸ Recap of Combine ▸ Let’s expect next year’s WWDC!