Manages display objects that may be used to render data, in a component like
ListView
or TabBar
.
1.0.0
.See also:
Static methods
staticwithClass<T, S, B>(displayObjectType:Class<T>, ?update:(target:T, state:S) ‑> Void, ?reset:(target:T, state:S) ‑> Void, ?destroy:T ‑> Void):DisplayObjectRecycler<T, S, B>
Creates a DisplayObjectRecycler
that instantiates a display object by
instantiating the specified class. The class must have a constructor
with zero required arguments.
To instantiate an object with one or more required constructor
arguments, use DisplayObjectRecycler.withFunction()
instead.
staticwithFunction<T, S, B>(create:() ‑> T, ?update:(target:T, state:S) ‑> Void, ?reset:(target:T, state:S) ‑> Void, ?destroy:T ‑> Void):DisplayObjectRecycler<T, S, B>
Creates a DisplayObjectRecycler
that instantiates a display object by
calling the specified function.
Methods
dynamicdestroy(target:T):Void
Destroys/disposes a display object when it will no longer be used.
1.0.0
.dynamicreset(target:T, state:S):Void
Prepares a display object to be used again. This method should restore
the display object to its original state from when it was returned by
create()
.
1.0.0
.dynamicupdate(target:T, state:S):Void
Updates the properties an existing display object. It may be a display
object that was used previously, but it will have been passed to
reset()
first, to ensure that it has been restored to its original
state when it was returned from create()
.
1.0.0
.