remove previous items

This commit is contained in:
Pfeil, Scott Robert 2020-04-15 17:42:57 -04:00
parent d19b46d3e9
commit a57f07c22b

View File

@ -46,6 +46,7 @@ open class MoleculeStackView: Stack<StackModel> {
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 (previousModel == nil) || Self.nameForReuse(with: previousModel!, delegateObject) != Self.nameForReuse(with: model, delegateObject) {
removeAllItemViews()
stackItems = []
createStackItemsFromModel(model, delegateObject, additionalData)
} else {