LayoutKit
LayoutKit copied to clipboard
Does arrangement in ReloadableViewLayoutAdapter need replace every time?
https://github.com/linkedin/LayoutKit/blob/master/LayoutKit/Views/ReloadableViewLayoutAdapter.swift#L91-L93
Say I have a table view with 1000 items, then I insert 1 item in it, it will regenerate the whole arrangement...
Could we just replace the updated items?
It does regenerate all arrangements. Now that BatchUpdates is a parameter (it wasn't initially), it would be possible to do the optimization you suggest. This optimization can only be done though when BatchUpdates is non-nil (otherwise we don't know what has changed).
@nicksnyder Sure, what I want to do is avoid regenerate all arrangements when possible.
I would like to send a PR about this if you agree. Thanks.
Yeah, a PR would be welcome, thanks!