Slide 1

Slide 1 text

Collection Views Diffable Data Source + Compositional Layout Marina Gornostaeva @hybridcattt Swift Island 2019 !1

Slide 2

Slide 2 text

Collection Views Part 1. Diffable Data Sources • Basics • Dynamic data Part 2. Compositional Layout • Basics • Per-section layout • Advanced layouts

Slide 3

Slide 3 text

Diffable Data Source • Generic • Source of truth • performBatchUpdates - gone • Free diffing and animations

Slide 4

Slide 4 text

Compositional layout • Declarative • Forget index paths, think in patterns • Composable, fast • Fractional and estimated sizes

Slide 5

Slide 5 text

NSCollectionLayout… • Size • Item • Group • Section

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

Next steps • Layout-margin based alignment • Environment-specific layout • Supplementary views (badges, headers) • Your own idea!

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Thank you