diff --git a/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index e12b9c0d..f5ca5342 100644 --- a/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -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 } } diff --git a/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift b/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift index 43e7655d..5ca80ba7 100644 --- a/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift +++ b/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/BarsIndicatorView.swift @@ -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 diff --git a/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/NumericIndicatorView.swift b/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/NumericIndicatorView.swift index cb91e1d3..776c9ff6 100644 --- a/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/NumericIndicatorView.swift +++ b/MVMCoreUI/Atoms/Views/CarouselIndicator/IndicatorViews/NumericIndicatorView.swift @@ -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() } } diff --git a/MVMCoreUI/Organisms/Carousel.swift b/MVMCoreUI/Organisms/Carousel.swift index cc230e66..928ce8da 100644 --- a/MVMCoreUI/Organisms/Carousel.swift +++ b/MVMCoreUI/Organisms/Carousel.swift @@ -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) }