Constraints added
This commit is contained in:
parent
ba51d7f3c2
commit
62e1d28305
@ -19,7 +19,6 @@ import UIKit
|
|||||||
let leftLabel = Label.commonLabelB1(true)
|
let leftLabel = Label.commonLabelB1(true)
|
||||||
let rightLabel = Label.commonLabelB1(true)
|
let rightLabel = Label.commonLabelB1(true)
|
||||||
let view = View()
|
let view = View()
|
||||||
let horizontalPadding = MFStyler.defaultHorizontalPaddingForApplicationWidth()
|
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - View Lifecycle
|
||||||
@ -35,9 +34,6 @@ import UIKit
|
|||||||
|
|
||||||
override open func setupView() {
|
override open func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
guard leftLabel.superview == nil else {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
contentView.addSubview(view)
|
contentView.addSubview(view)
|
||||||
view.addSubview(progressBar)
|
view.addSubview(progressBar)
|
||||||
@ -47,30 +43,17 @@ import UIKit
|
|||||||
|
|
||||||
//constraints
|
//constraints
|
||||||
|
|
||||||
leftLabel.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
|
NSLayoutConstraint.pinViews(leftView: leftLabel, rightView: rightLabel, alignTop: false)
|
||||||
leftLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
|
|
||||||
|
|
||||||
rightLabel.leadingAnchor.constraint(greaterThanOrEqualTo: leftLabel.trailingAnchor,constant: horizontalPadding).isActive = true
|
|
||||||
rightLabel.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
|
|
||||||
rightLabel.topAnchor.constraint(equalTo: view.topAnchor).isActive = true
|
|
||||||
|
|
||||||
progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
|
progressBar.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
|
||||||
progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
|
progressBar.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
|
||||||
progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true
|
progressBar.topAnchor.constraint(equalTo: leftLabel.bottomAnchor, constant: PaddingTwo).isActive = true
|
||||||
progressBar.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
|
progressBar.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
// MARK: - Molecule
|
// MARK: - Molecule
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
override open func reset() {
|
|
||||||
super.reset()
|
|
||||||
progressBar.reset()
|
|
||||||
leftLabel.reset()
|
|
||||||
rightLabel.reset()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
super.setWithModel(model, delegateObject, additionalData)
|
super.setWithModel(model, delegateObject, additionalData)
|
||||||
@ -83,5 +66,13 @@ import UIKit
|
|||||||
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
|
||||||
return 90
|
return 90
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override open func reset() {
|
||||||
|
super.reset()
|
||||||
|
progressBar.reset()
|
||||||
|
leftLabel.styleB1(true)
|
||||||
|
rightLabel.styleB1(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user