fixed constraints

This commit is contained in:
Kevin G Christiano 2020-03-02 09:24:07 -05:00
parent b8127da583
commit 64ada3e61d
4 changed files with 13 additions and 11 deletions

View File

@ -70,6 +70,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
bottomConstraint = bottomAnchor.constraint(equalTo: indicatorView.bottomAnchor, constant: PaddingTwo)
bottomConstraint?.isActive = true
indicatorView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
trailingAnchor.constraint(equalTo: indicatorView.trailingAnchor).isActive = true
}
}

View File

@ -68,7 +68,8 @@ open class BarsIndicatorView: View, IndicatorViewProtocol {
addSubview(stackView)
isUserInteractionEnabled = false
heightAnchor.constraint(equalToConstant: 4).isActive = true
stackView.heightAnchor.constraint(equalToConstant: 4).isActive = true
// heightAnchor.constraint(equalToConstant: 4).isActive = true
stackView.centerXAnchor.constraint(equalTo: centerXAnchor).isActive = true
stackView.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
trailingAnchor.constraint(equalTo: stackView.trailingAnchor).isActive = true

View File

@ -87,7 +87,7 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
super.setupView()
isUserInteractionEnabled = false
backgroundColor = .black
addSubview(pageCountLabel)
addSubview(leftArrow)
addSubview(rightArrow)
@ -112,11 +112,7 @@ open class NumericIndicatorView: View, IndicatorViewProtocol {
open func updateUI(previousIndex oldIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
self.pageCountLabel.text = "\(newIndex)/\(totalCount)"
self.layoutIfNeeded()
}
pageCountLabel.text = "\(newIndex)/\(totalCount)"
layoutIfNeeded()
}
}

View File

@ -97,6 +97,8 @@ open class Carousel: View {
//--------------------------------------------------
// MARK: - MVMCoreUIMoleculeViewProtocol
//--------------------------------------------------
public override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let carouselModel = model as? CarouselModel else { return }
@ -194,9 +196,9 @@ open class Carousel: View {
/// Returns the (identifier, class) of the molecule for the given map.
func getMoleculeInfo(with molecule: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject?) -> (identifier: String, class: AnyClass, molecule: MoleculeModelProtocol)? {
guard let className = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(molecule) ,
let moleculeName = (className as? ModelMoleculeViewProtocol.Type)?.nameForReuse(with: molecule, delegateObject) ?? molecule.moleculeName else {
return nil
}
let moleculeName = (className as? ModelMoleculeViewProtocol.Type)?.nameForReuse(with: molecule, delegateObject) ?? molecule.moleculeName
else { return nil }
return (moleculeName, className, molecule)
}