didn't carry over
This commit is contained in:
parent
2333a38035
commit
7b857414af
@ -29,16 +29,16 @@ import UIKit
|
|||||||
guard newValue != oldValue,
|
guard newValue != oldValue,
|
||||||
let self = self,
|
let self = self,
|
||||||
let index = self.dropDown.pickerData.firstIndex(of: newValue),
|
let index = self.dropDown.pickerData.firstIndex(of: newValue),
|
||||||
let model = self.listItemModel as? DropDownListItemModel
|
let dropListItemJSON = (self.listItemModel as? DropDownListItemModel).toJSON(),
|
||||||
|
let json2d = dropListItemJSON.optionalArrayForKey("molecules") as? [[[AnyHashable: Any]]],
|
||||||
|
!json2d.isEmpty && !(json2d.first?.isEmpty ?? false)
|
||||||
else { return }
|
else { return }
|
||||||
|
|
||||||
if self.previousIndex != NSNotFound {
|
if self.previousIndex != NSNotFound {
|
||||||
self.delegateObject?.moleculeDelegate?.removeMolecules(model.molecules[self.previousIndex], animation: .fade)
|
self.delegateObject?.moleculeDelegate?.removeMolecules(json2d[self.previousIndex], sender: self, animation: .fade)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let indexPath = self.delegateObject?.moleculeDelegate?.getIndexPath(for: model) {
|
self.delegateObject?.moleculeDelegate?.addMolecules(json2d[index], sender: self, animation: .fade)
|
||||||
self.delegateObject?.moleculeDelegate?.addMolecules(model.molecules[index], indexPath: indexPath, animation: .fade)
|
|
||||||
}
|
|
||||||
self.previousIndex = index
|
self.previousIndex = index
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user