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)
}
public convenience init(model: ArrowModel, degrees: Float = 0) {
self.init(frame: .zero)
self.model = model
arrowModel?.degrees = degrees
}
// public convenience init(degrees: Float = 0) {
// self.init(frame: .zero)
// self.model = ArrowModel()
// arrowModel?.degrees = degrees
// }
public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")

View File

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

View File

@ -45,7 +45,7 @@ extension MoleculeViewProtocol {
}
// 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 static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {

View File

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