Switch molecule
This commit is contained in:
parent
b73c916192
commit
f53bd03212
@ -17,7 +17,7 @@ import UIKit
|
|||||||
var delegateObject: DelegateObject?
|
var delegateObject: DelegateObject?
|
||||||
|
|
||||||
@objc func switchChanged() {
|
@objc func switchChanged() {
|
||||||
let delegate = delegateObject as? MVMCoreUIDelegateObject
|
let delegate = delegateObject as? MVMCoreUIDelegateObject
|
||||||
if let delegate = delegate {
|
if let delegate = delegate {
|
||||||
let formValidator = delegate.formValidationProtocol?.formValidatorModel?()
|
let formValidator = delegate.formValidationProtocol?.formValidatorModel?()
|
||||||
formValidator?.enableByValidation()
|
formValidator?.enableByValidation()
|
||||||
@ -47,8 +47,6 @@ import UIKit
|
|||||||
|
|
||||||
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: DelegateObject?, additionalData: [AnyHashable: Any]?) {
|
open override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: DelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
isRequired = json?[KeyRequired] as? Bool ?? false
|
|
||||||
self.delegateObject = delegateObject
|
|
||||||
mvmSwitch.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
mvmSwitch.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||||
label.setWithJSON(json?.optionalDictionaryForKey("label"), delegateObject: delegateObject, additionalData: additionalData)
|
label.setWithJSON(json?.optionalDictionaryForKey("label"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
mfTextButton.setWithJSON(json?.optionalDictionaryForKey("textButton"), delegateObject: delegateObject, additionalData: additionalData)
|
mfTextButton.setWithJSON(json?.optionalDictionaryForKey("textButton"), delegateObject: delegateObject, additionalData: additionalData)
|
||||||
@ -111,10 +109,6 @@ import UIKit
|
|||||||
mvmSwitch.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
mvmSwitch.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func formFieldName() -> String? {
|
|
||||||
return json?.optionalStringForKey(KeyFieldKey)
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func needsToBeConstrained() -> Bool {
|
public override func needsToBeConstrained() -> Bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user