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

Clarity of viewReuseId #137

Open
dgattey opened this issue Apr 27, 2017 · 1 comment
Open

Clarity of viewReuseId #137

dgattey opened this issue Apr 27, 2017 · 1 comment

Comments

@dgattey
Copy link
Contributor

dgattey commented Apr 27, 2017

Currently, it's unclear from the docs what viewReuseId means. If it should be used to uniquely identify every single view, if it's useful in collection view cells, if it's useful for animation, etc. This issue serves as a bookmark to make this clearer in the documentation.

For those interested, viewReuseId should not uniquely identify each view. Rather, it should identify layouts that are the same across a few different views. If you have a collection view with cells that all have the same layouts but different content, each element of the cell should have a unique view reuse ID. Therefore, every cell will have the same view reuse IDs for its elements.

Additionally, view reuse IDs are useful for animations. It makes them faster because it can reuse the first layout's elements when animating to a second layout.

@nicksnyder
Copy link
Collaborator

More doc would be good. Similar to reuseIdentifier for UITableViewCell and UICollectionViewCell.

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