ios - configure UICollectionView cell on initial lookup -


i getting cells uicollectionview calling dequeuereusablecellwithreuseidentifier:. want set specific configuration information first time cell returned method , not subsequently when gets reused. there hook somewhere can run "one time" code on collection view cells?

obviously set information every time or use boolean keep track of whether or not cell has been initialized, i'd know if there's cleaner way first.

this easy enough within cell's implementation there's no convenient way data source differentiate newly created vs reused cells. if configuration must supplied data source data source need check if cell has been configured already.

the cells created once can use init or awakefromnib set initial state. cells have prepareforreuse called when being reused allowing perform changes need make per-use.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -