Mobiconf 2018: Bj Kandel, Zalando

33:40 93 views 100% Published one year ago

Topic: ModelDiff state based UI rendering in iOS

When a model can have equality it can be compared. When a list of models can be compared, we can produce diffSet. These diffSet can be applied to the existing UI elements (UITableView and CollectionView) with little effort.

The practical use case can be an efficient use of memory and UI reuse. However, the bigger side is every code that doesn't interact with the UI can be written in a pure functional programming paradigm (without side effects, shared state). Extending a level beyond, simple equality is not merely enough for models with children which themselves are comparable. To overcome this nested equality and nested diffing we can use protocols and come up with a nested diffSet. This can be used for Sections/Rows.

The talk will cover explaining the naive algorithm and the intent behind nested diffing on model layer. The talk will present a generic list controller that takes these diffedState and renders with animation. And I will also present some functional inspiration behind the design of ModelDiff state based app development.



Link Original video





Mobiconf


Mobiconf

From 04/10/2018 to 05/10/2018 in Krakow, Poland