Typealiases

The following typealiases are available globally.

  • Let’s say your data model consists of different sections containing different model types. Since SectionedValues requires a uniform type for all of its rows, this can be a clunky situation. You can address this in a couple of ways. The first is to define a custom enum that encompasses all of the things that could be in your data model - if section 1 has a bunch of Strings, and section 2 has a bunch of Ints, define a StringOrInt enum that conforms to Equatable, and fill the SectionedValues that you use to drive your DiffCalculator up with those. Alternatively, if you are lazy, and your models all conform to Hashable, you can use a SimpleTableViewDiffCalculator instead.

    Declaration

    Swift

    typealias SimpleTableViewDiffCalculator = TableViewDiffCalculator<AnyHashable, AnyHashable>
  • See SimpleTableViewDiffCalculator for explanation

    Declaration

    Swift

    typealias SimpleCollectionViewDiffCalculator = CollectionViewDiffCalculator<AnyHashable, AnyHashable>