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 ofString
s, and section 2 has a bunch ofInt
s, define aStringOrInt
enum that conforms toEquatable
, and fill theSectionedValues
that you use to drive your DiffCalculator up with those. Alternatively, if you are lazy, and your models all conform toHashable
, you can use a SimpleTableViewDiffCalculator instead.Declaration
Swift
typealias SimpleTableViewDiffCalculator = TableViewDiffCalculator<AnyHashable, AnyHashable>
-
See SimpleTableViewDiffCalculator for explanation
Declaration
Swift
typealias SimpleCollectionViewDiffCalculator = CollectionViewDiffCalculator<AnyHashable, AnyHashable>