latest state

This commit is contained in:
Kevin G Christiano 2020-05-05 09:00:47 -04:00
parent 3347f4a0af
commit 8b05b20f51
4 changed files with 25 additions and 17 deletions

View File

@ -78,11 +78,11 @@ open class Arrow: View {
super.init(frame: frame) super.init(frame: frame)
} }
public convenience init(model: ArrowModel, degrees: Float = 0) { // public convenience init(degrees: Float = 0) {
self.init(frame: .zero) // self.init(frame: .zero)
self.model = model // self.model = ArrowModel()
arrowModel?.degrees = degrees // arrowModel?.degrees = degrees
} // }
public required init?(coder: NSCoder) { public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented") fatalError("init(coder:) has not been implemented")

View File

@ -24,14 +24,14 @@ open class NumericIndicatorView: CarouselIndicator {
}() }()
let leftArrow: Arrow = { let leftArrow: Arrow = {
let arrow = Arrow(model: ArrowModel(), degrees: 180) let arrow = Arrow(model: ArrowModel(), nil, nil)
arrow.isAccessibilityElement = false arrow.isAccessibilityElement = false
arrow.pinHeightAndWidth() arrow.pinHeightAndWidth()
return arrow return arrow
}() }()
let rightArrow: Arrow = { let rightArrow: Arrow = {
let arrow = Arrow(model: ArrowModel()) let arrow = Arrow()
arrow.pinHeightAndWidth() arrow.pinHeightAndWidth()
return arrow return arrow
}() }()

View File

@ -45,7 +45,7 @@ extension MoleculeViewProtocol {
} }
// Do nothing, optionals. // Do nothing, optionals.
public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {} public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {}
public func reset() {} public func reset() {}
public static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { public static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {

View File

@ -8,11 +8,16 @@
import UIKit import UIKit
@objcMembers open class View: UIView, MoleculeViewProtocol { @objcMembers open class View: UIView, MoleculeViewProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
open var model: MoleculeModelProtocol? open var model: MoleculeModelProtocol?
private var initialSetupPerformed = false private var initialSetupPerformed = false
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Initialization // MARK: - Initialization
//-------------------------------------------------- //--------------------------------------------------
@ -21,7 +26,7 @@ import UIKit
super.init(frame: .zero) super.init(frame: .zero)
initialSetup() initialSetup()
} }
public convenience init() { public convenience init() {
self.init(frame: .zero) self.init(frame: .zero)
} }
@ -38,12 +43,15 @@ import UIKit
} }
} }
// MARK:- MoleculeViewProtocol //--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
self.model = model self.model = model
if let backgroundColor = model.backgroundColor { if let backgroundColor = model.backgroundColor {
self.backgroundColor = backgroundColor.uiColor self.backgroundColor = backgroundColor.uiColor
} }
} }
open class func nameForReuse(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> String? { open class func nameForReuse(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
@ -66,8 +74,8 @@ import UIKit
// MARK:- MVMCoreViewProtocol // MARK:- MVMCoreViewProtocol
extension View: MVMCoreViewProtocol { extension View: MVMCoreViewProtocol {
open func updateView(_ size: CGFloat) {} open func updateView(_ size: CGFloat) { }
/// Will be called only once. /// Will be called only once.
open func setupView() { open func setupView() {
translatesAutoresizingMaskIntoConstraints = false translatesAutoresizingMaskIntoConstraints = false