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

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

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

Marina Vatmakhter

July 04, 2019
Tweet

More Decks by Marina Vatmakhter

Other Decks in Programming

Transcript

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

    @hybridcattt

    Swift Island 2019
    !1

    View full-size slide

  2. Collection Views
    Part 1. Diffable Data Sources

    • Basics

    • Dynamic data

    Part 2. Compositional Layout

    • Basics

    • Per-section layout

    • Advanced layouts

    View full-size slide

  3. Diffable Data Source
    • Generic

    • Source of truth

    • performBatchUpdates - gone

    • Free diffing and animations

    View full-size slide

  4. Compositional layout
    • Declarative

    • Forget index paths, think in patterns

    • Composable, fast

    • Fractional and estimated sizes

    View full-size slide

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

    View full-size 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 full-size slide

  7. Next steps
    • Layout-margin based alignment

    • Environment-specific layout

    • Supplementary views (badges, headers)

    • Your own idea!

    View full-size 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 full-size slide