remove previous items
This commit is contained in:
parent
d19b46d3e9
commit
a57f07c22b
@ -46,6 +46,7 @@ open class MoleculeStackView: Stack<StackModel> {
|
|||||||
open override func setStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
open override func setStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
// If the items in the stack are different, clear them, create new ones.
|
// If the items in the stack are different, clear them, create new ones.
|
||||||
if (previousModel == nil) || Self.nameForReuse(with: previousModel!, delegateObject) != Self.nameForReuse(with: model, delegateObject) {
|
if (previousModel == nil) || Self.nameForReuse(with: previousModel!, delegateObject) != Self.nameForReuse(with: model, delegateObject) {
|
||||||
|
removeAllItemViews()
|
||||||
stackItems = []
|
stackItems = []
|
||||||
createStackItemsFromModel(model, delegateObject, additionalData)
|
createStackItemsFromModel(model, delegateObject, additionalData)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user