latest state

This commit is contained in:
Kevin G Christiano 2020-02-28 13:10:15 -05:00
parent 1196dee4de
commit 3470e77b76
4 changed files with 20 additions and 27 deletions

View File

@ -329,7 +329,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
// MARK: - MoleculeViewProtocol // MARK: - MoleculeViewProtocol
//-------------------------------------------------- //--------------------------------------------------
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
open override func set(with model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
// super.setWithModel(model, delegateObject, additionalData) // super.setWithModel(model, delegateObject, additionalData)
guard let model = model as? CarouselIndicatorModel else { return } guard let model = model as? CarouselIndicatorModel else { return }

View File

@ -22,22 +22,18 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
return label return label
}() }()
let leftArrow: ImageView = { let leftArrow: Arrow = {
let arrow = UIImage(named: "peakingRightArrow")?.withRenderingMode(.alwaysTemplate).withHorizontallyFlippedOrientation() let arrow = Arrow()
let imageView = ImageView(image: arrow) (arrow.model as? ArrowModel)?.degrees = 180
imageView.tintColor = .mvmBlack arrow.pinHeightAndWidth()
imageView.heightAnchor.constraint(equalToConstant: PaddingTwo).isActive = true arrow.setNeedsDisplay()
imageView.widthAnchor.constraint(equalToConstant: PaddingTwo).isActive = true return arrow
return imageView
}() }()
let rightArrow: ImageView = { let rightArrow: Arrow = {
let arrow = UIImage(named: "peakingRightArrow")?.withRenderingMode(.alwaysTemplate) let arrow = Arrow()
let imageView = ImageView(image: arrow) arrow.pinHeightAndWidth()
imageView.tintColor = .mvmBlack return arrow
imageView.heightAnchor.constraint(equalToConstant: PaddingTwo).isActive = true
imageView.widthAnchor.constraint(equalToConstant: PaddingTwo).isActive = true
return imageView
}() }()
//-------------------------------------------------- //--------------------------------------------------
@ -93,17 +89,16 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
isUserInteractionEnabled = false isUserInteractionEnabled = false
addSubview(pageCountLabel) addSubview(pageCountLabel)
addSubview(leftArrow)
addSubview(rightArrow)
pageCountLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true pageCountLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
pageCountLabel.topAnchor.constraint(equalTo: topAnchor).isActive = true pageCountLabel.topAnchor.constraint(equalTo: topAnchor).isActive = true
bottomAnchor.constraint(equalTo: pageCountLabel.bottomAnchor).isActive = true bottomAnchor.constraint(equalTo: pageCountLabel.bottomAnchor).isActive = true
addSubview(leftArrow)
leftArrow.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true leftArrow.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
addSubview(rightArrow)
rightArrow.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true rightArrow.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
NSLayoutConstraint.activate(NSLayoutConstraint.constraints(withVisualFormat: "H:|[leftArrow]-(padding)-[pageCountLabel]-(padding)-[rightArrow]|", NSLayoutConstraint.activate(NSLayoutConstraint.constraints(withVisualFormat: "H:|-[leftArrow]-(padding)-[pageCountLabel]-(padding)-[rightArrow]-|",
options: .directionLeadingToTrailing, options: .directionLeadingToTrailing,
metrics: ["padding": PaddingOne], metrics: ["padding": PaddingOne],
views: ["leftArrow": leftArrow, views: ["leftArrow": leftArrow,

View File

@ -60,7 +60,7 @@ open class ImageView: UIImageView, ModelMoleculeViewProtocol {
} }
open func setWithModel(_ 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

View File

@ -48,13 +48,9 @@ open class StackView: UIStackView, ModelMoleculeViewProtocol {
// MARK: - ModelMoleculeViewProtocol // MARK: - ModelMoleculeViewProtocol
//-------------------------------------------------- //--------------------------------------------------
public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) { open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
}
open func setWithModel(_ 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
} }
} }