model reuse again

This commit is contained in:
Kevin G Christiano 2020-01-24 10:41:38 -05:00
parent f43e018e21
commit af7e813e18
2 changed files with 13 additions and 12 deletions

View File

@ -277,19 +277,12 @@ import UIKit
guard let model = model as? TextEntryFieldModel else { return }
FormValidator.setupValidation(molecule: self, delegate: delegateObject?.formValidationProtocol)
if let enabledTextColor = model.enabledTextColor {
textColor.enabled = enabledTextColor.uiColor
}
if let disabledTextColor = model.disabledTextColor {
textColor.disabled = disabledTextColor.uiColor
}
textColor.enabled = model.enabledTextColor?.uiColor
textColor.disabled = model.disabledTextColor?.uiColor
text = model.text
placeholder = model.placeholder
switch model.type {
case "password":
textField.isSecureTextEntry = true

View File

@ -118,7 +118,7 @@ import UIKit
//--------------------------------------------------
/// Holds reference to delegateObject to inform molecular tableView of an update.
weak var delegateObject: MVMCoreUIDelegateObject?
var delegateObject: MVMCoreUIDelegateObject?
//--------------------------------------------------
// MARK: - Lifecycle
@ -271,9 +271,17 @@ import UIKit
layoutIfNeeded()
}
}
//--------------------------------------------------
// MARK: - MVMCoreUIMoleculeViewProtocol
//--------------------------------------------------
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
self.delegateObject = delegateObject
}
}
// MARK:- MVMCoreUIMoleculeViewProtocol
extension EntryFieldContainer {
override open func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {