update only after the model sets the properties
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
8829bd7457
commit
7b0f4e4328
@ -14,10 +14,12 @@ import MVMCore
|
||||
///-----------------------------------------------------------------------------
|
||||
public protocol VDSMoleculeViewProtocol: MoleculeViewProtocol, MVMCoreViewProtocol {
|
||||
associatedtype ViewModel: MoleculeModelProtocol
|
||||
var shouldUpdateView: Bool { get set }
|
||||
var viewModel: ViewModel! { get set }
|
||||
var delegateObject: MVMCoreUIDelegateObject? { get set }
|
||||
var additionalData: [AnyHashable: Any]? { get set }
|
||||
func viewModelDidUpdate()
|
||||
func setNeedsUpdate()
|
||||
}
|
||||
|
||||
extension VDSMoleculeViewProtocol {
|
||||
@ -32,7 +34,10 @@ extension VDSMoleculeViewProtocol {
|
||||
self.delegateObject = delegateObject
|
||||
self.additionalData = additionalData
|
||||
viewModel = castedModel
|
||||
shouldUpdateView = false
|
||||
viewModelDidUpdate()
|
||||
shouldUpdateView = true
|
||||
setNeedsUpdate()
|
||||
}
|
||||
|
||||
public func update(viewModel: ViewModel){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user