latest state
This commit is contained in:
parent
1196dee4de
commit
3470e77b76
@ -329,7 +329,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
||||
// 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)
|
||||
|
||||
guard let model = model as? CarouselIndicatorModel else { return }
|
||||
|
||||
@ -22,22 +22,18 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
|
||||
return label
|
||||
}()
|
||||
|
||||
let leftArrow: ImageView = {
|
||||
let arrow = UIImage(named: "peakingRightArrow")?.withRenderingMode(.alwaysTemplate).withHorizontallyFlippedOrientation()
|
||||
let imageView = ImageView(image: arrow)
|
||||
imageView.tintColor = .mvmBlack
|
||||
imageView.heightAnchor.constraint(equalToConstant: PaddingTwo).isActive = true
|
||||
imageView.widthAnchor.constraint(equalToConstant: PaddingTwo).isActive = true
|
||||
return imageView
|
||||
let leftArrow: Arrow = {
|
||||
let arrow = Arrow()
|
||||
(arrow.model as? ArrowModel)?.degrees = 180
|
||||
arrow.pinHeightAndWidth()
|
||||
arrow.setNeedsDisplay()
|
||||
return arrow
|
||||
}()
|
||||
|
||||
let rightArrow: ImageView = {
|
||||
let arrow = UIImage(named: "peakingRightArrow")?.withRenderingMode(.alwaysTemplate)
|
||||
let imageView = ImageView(image: arrow)
|
||||
imageView.tintColor = .mvmBlack
|
||||
imageView.heightAnchor.constraint(equalToConstant: PaddingTwo).isActive = true
|
||||
imageView.widthAnchor.constraint(equalToConstant: PaddingTwo).isActive = true
|
||||
return imageView
|
||||
let rightArrow: Arrow = {
|
||||
let arrow = Arrow()
|
||||
arrow.pinHeightAndWidth()
|
||||
return arrow
|
||||
}()
|
||||
|
||||
//--------------------------------------------------
|
||||
@ -93,17 +89,16 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
|
||||
isUserInteractionEnabled = false
|
||||
|
||||
addSubview(pageCountLabel)
|
||||
addSubview(leftArrow)
|
||||
addSubview(rightArrow)
|
||||
|
||||
pageCountLabel.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
|
||||
pageCountLabel.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
||||
bottomAnchor.constraint(equalTo: pageCountLabel.bottomAnchor).isActive = true
|
||||
|
||||
addSubview(leftArrow)
|
||||
leftArrow.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
|
||||
|
||||
addSubview(rightArrow)
|
||||
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,
|
||||
metrics: ["padding": PaddingOne],
|
||||
views: ["leftArrow": leftArrow,
|
||||
|
||||
@ -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
|
||||
if let backgroundColor = model?.backgroundColor {
|
||||
self.backgroundColor = backgroundColor.uiColor
|
||||
|
||||
@ -48,13 +48,9 @@ open class StackView: UIStackView, ModelMoleculeViewProtocol {
|
||||
// MARK: - ModelMoleculeViewProtocol
|
||||
//--------------------------------------------------
|
||||
|
||||
public func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
|
||||
}
|
||||
|
||||
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
self.model = model
|
||||
if let backgroundColor = model?.backgroundColor {
|
||||
if let backgroundColor = model.backgroundColor {
|
||||
self.backgroundColor = backgroundColor.uiColor
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user