correcting errors. Improving Control.
This commit is contained in:
parent
335649860b
commit
ed18970625
@ -11,7 +11,7 @@ import MVMCore
|
||||
/**
|
||||
This class expects its height and width to be equal.
|
||||
*/
|
||||
@objcMembers open class Checkbox: UIControl, MVMCoreViewProtocol, MVMCoreUIMoleculeViewProtocol, MVMCoreUIViewConstrainingProtocol {
|
||||
@objcMembers open class Checkbox: Control, MVMCoreUIViewConstrainingProtocol {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
@ -149,7 +149,7 @@ import MVMCore
|
||||
fatalError("xib file is not implemented for Checkbox.")
|
||||
}
|
||||
|
||||
public convenience init() {
|
||||
public convenience override init() {
|
||||
self.init(frame:.zero)
|
||||
}
|
||||
|
||||
@ -182,7 +182,8 @@ import MVMCore
|
||||
layer.borderColor = borderColor.cgColor
|
||||
}
|
||||
|
||||
open func setupView() {
|
||||
open override func setupView() {
|
||||
super.setupView()
|
||||
|
||||
guard constraints.isEmpty else { return }
|
||||
|
||||
@ -374,7 +375,8 @@ import MVMCore
|
||||
return true
|
||||
}
|
||||
|
||||
open func reset() {
|
||||
open override func reset() {
|
||||
super.reset()
|
||||
|
||||
isEnabled(true)
|
||||
shapeLayer?.removeAllAnimations()
|
||||
@ -394,7 +396,8 @@ import MVMCore
|
||||
setupView()
|
||||
}
|
||||
|
||||
public func updateView(_ size: CGFloat) {
|
||||
public override func updateView(_ size: CGFloat) {
|
||||
super.updateView(size)
|
||||
|
||||
if let dimension = sizeObject?.getValueBased(onSize: size) {
|
||||
widthConstraint?.constant = dimension
|
||||
@ -404,7 +407,8 @@ import MVMCore
|
||||
layoutIfNeeded()
|
||||
}
|
||||
|
||||
public func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
public override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
|
||||
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
|
||||
self.delegateObject = delegateObject
|
||||
FormValidator.setupValidation(molecule: self, delegate: delegateObject?.formValidationProtocol)
|
||||
|
||||
|
||||
@ -8,17 +8,25 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
public class Control: UIControl {
|
||||
var json: [AnyHashable: Any]?
|
||||
@objcMembers open class Control: UIControl {
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
//--------------------------------------------------
|
||||
|
||||
public var json: [AnyHashable: Any]?
|
||||
|
||||
private var initialSetupPerformed = false
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
//--------------------------------------------------
|
||||
|
||||
public override init(frame: CGRect) {
|
||||
super.init(frame: .zero)
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
init() {
|
||||
public init() {
|
||||
super.init(frame: .zero)
|
||||
initialSetup()
|
||||
}
|
||||
@ -28,6 +36,10 @@ public class Control: UIControl {
|
||||
initialSetup()
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Setup
|
||||
//--------------------------------------------------
|
||||
|
||||
public func initialSetup() {
|
||||
if !initialSetupPerformed {
|
||||
initialSetupPerformed = true
|
||||
@ -36,7 +48,9 @@ public class Control: UIControl {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreViewProtocol
|
||||
extension Control: MVMCoreViewProtocol {
|
||||
|
||||
public func updateView(_ size: CGFloat) {
|
||||
}
|
||||
|
||||
@ -47,6 +61,7 @@ extension Control: MVMCoreViewProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
extension Control: MVMCoreUIMoleculeViewProtocol {
|
||||
public func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {
|
||||
self.json = json
|
||||
|
||||
Loading…
Reference in New Issue
Block a user