Typealiases
The following typealiases are available globally.
-
Let’s say your data model consists of different sections containing different model types. Since
SectionedValuesrequires 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 ofStrings, and section 2 has a bunch ofInts, define aStringOrIntenum that conforms toEquatable, and fill theSectionedValuesthat 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>
View on GitHub
Typealiases Reference