Go to file
Siyu Yue 2097758b9b Fix layout call 2022-12-20 14:12:21 -08:00
Examples Fix crash 2022-12-17 15:37:29 -08:00
Sources Fix layout call 2022-12-20 14:12:21 -08:00
external Initial repo setup 2022-12-01 09:44:26 -08:00
.bazelrc Initial repo setup 2022-12-01 09:44:26 -08:00
.gitignore Initial repo setup 2022-12-01 09:44:26 -08:00
BUILD Initial repo setup 2022-12-01 09:44:26 -08:00
LICENSE Initial commit 2022-12-01 08:39:55 -08:00
README.md ListDiffUI 2022-12-17 09:22:36 -08:00
WORKSPACE ListDiffUI 2022-12-17 09:22:36 -08:00
format.sh ListDiffUI 2022-12-17 09:22:36 -08:00
repositories.bzl ListDiffUI 2022-12-17 09:22:36 -08:00
swift-format-config.json ListDiffUI 2022-12-17 09:22:36 -08:00

README.md

ListDiffUI

A descriptive, diffable data source for UICollectionView.

Features

MVVMC Architechture

ListDiffUI employs Model-View-ViewModel-Controller architechture for each cell in the list.

Uni-directional Dataflow

Data flows in one direction in ListDiffUI. Each data mutation should update Model first, and then update ViewModel. This greatly reduces potentional data inconsitency (and crashes) between model and view.

Descriptive

Describe the structure of the list, with sections:

dataSource.setRootSection(
  CompositeSection(
    ListSection<
      Bool, LoadingSpinnerController
    >(isLoading) {
      $0 ? LoadingSpinnerViewModel() : nil
    },
    ListSection<
      ItemViewModel, ItemCellController
    >(items)
  )
)

Diff updates

ListDiffUI internally uses the ListDiff algorithm to compute diff and perform batch updates on the collection view.