rollback some behavior
This commit is contained in:
parent
fa99ba6b42
commit
5398008a0d
@ -26,8 +26,6 @@
|
|||||||
return accordionButton
|
return accordionButton
|
||||||
}()
|
}()
|
||||||
|
|
||||||
var delegateObject: MVMCoreUIDelegateObject?
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Setup
|
// MARK: - Setup
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -36,27 +34,11 @@
|
|||||||
customAccessoryView = true
|
customAccessoryView = true
|
||||||
super.setupView()
|
super.setupView()
|
||||||
accessoryView = accordionButton
|
accessoryView = accordionButton
|
||||||
|
accessoryView?.isUserInteractionEnabled = false
|
||||||
accordionButton.addActionBlock(event: .touchUpInside) { _ in
|
|
||||||
guard let model = self.accordionListItemModel else { return }
|
|
||||||
|
|
||||||
if let indexPath = self.delegateObject?.moleculeDelegate?.getIndexPath(for: model) {
|
|
||||||
self.toggleAccordion(at: indexPath, delegateObject: self.delegateObject)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
|
||||||
// MARK: - Methods
|
|
||||||
//--------------------------------------------------
|
|
||||||
|
|
||||||
override public func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
override public func didSelectCell(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
|
|
||||||
toggleAccordion(at: index, delegateObject: delegateObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
func toggleAccordion(at index: IndexPath, delegateObject: MVMCoreUIDelegateObject?) {
|
|
||||||
|
|
||||||
accordionButton.isSelected.toggle()
|
accordionButton.isSelected.toggle()
|
||||||
accordionButton.setTitle(accordionButton.isSelected ? "-" : "+", for: .normal)
|
accordionButton.setTitle(accordionButton.isSelected ? "-" : "+", for: .normal)
|
||||||
|
|
||||||
@ -74,9 +56,4 @@
|
|||||||
bottomSeparatorView?.isHidden = accordionButton.isSelected
|
bottomSeparatorView?.isHidden = accordionButton.isSelected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
|
||||||
super.set(with: model, delegateObject, additionalData)
|
|
||||||
self.delegateObject = delegateObject
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user