Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Does arrangement in ReloadableViewLayoutAdapter need replace every time? #126

Open
RoCry opened this issue Apr 13, 2017 · 3 comments
Open
Assignees

Comments

@RoCry
Copy link
Contributor

RoCry commented Apr 13, 2017

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?

@nicksnyder
Copy link
Collaborator

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).

@RoCry
Copy link
Contributor Author

RoCry commented Apr 18, 2017

@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.

@nicksnyder
Copy link
Collaborator

Yeah, a PR would be welcome, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants