ListDiff is an Swift port of IGListKit's IGListDiff. It is an implementation of an algorithm by Paul Heckel.
The motivation for this project came from the following challenge which I learnt about from Ryan Nystrom's talk in iOSConf.SG.
swift package generate-xcodeproj
During the port, I made several decisions which I would like to rationalize here.
- Using caseless enum as namespace. See Erica Sadun's post here.
- No support for index paths. Decided that this is out of the scope.
- Stack vs Heap. AFAIK, Swift does not advocates thinking about stack vs heap allocation model, leaving the optimization decisions to compiler instead. Nevertheless, some of the guideline do favour
struct
more, so onlyList.Entry
is a (final) class as we need reference to its instances.
- TODO: Equality check.