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

Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019

Marina
July 04, 2019

Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019

Marina

July 04, 2019
Tweet

More Decks by Marina

Other Decks in Programming

Transcript

  1. Collection Views
    Diffable Data Source
    +
    Compositional Layout
    Marina Gornostaeva

    @hybridcattt

    Swift Island 2019
    !1

    View Slide

  2. Collection Views
    Part 1. Diffable Data Sources

    • Basics

    • Dynamic data

    Part 2. Compositional Layout

    • Basics

    • Per-section layout

    • Advanced layouts

    View Slide

  3. Diffable Data Source
    • Generic

    • Source of truth

    • performBatchUpdates - gone

    • Free diffing and animations

    View Slide

  4. Compositional layout
    • Declarative

    • Forget index paths, think in patterns

    • Composable, fast

    • Fractional and estimated sizes

    View Slide

  5. NSCollectionLayout…
    • Size
    • Item
    • Group
    • Section

    View Slide

  6. Known bugs in Xcode 11b3
    • Orthogonal layout

    • crazy artefacts for added/removed sections

    • incorrect content size w/ group insets

    • incorrect item width w/ item spacing

    • large title not always showing at first

    View Slide

  7. Next steps
    • Layout-margin based alignment

    • Environment-specific layout

    • Supplementary views (badges, headers)

    • Your own idea!

    View Slide

  8. Next steps
    • Estimated sizes

    • Layout-margin based alignment

    • Environment-specific layout

    • Supplementary views (badges, headers)

    • Your own idea!

    • Check out the repo with implementations for these ^ and all the steps
    from the workshop!

    https://github.com/hybridcattt/IslandGuideSample

    View Slide

  9. Thank you

    View Slide