From ee107a25cfea2bb56847ec63321e75232fc68900 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Thu, 7 May 2020 14:51:23 -0400 Subject: [PATCH] addressing layout issue --- .../CarouselIndicator/BarsIndicatorView.swift | 20 +++++++---------- .../NumericIndicatorView.swift | 22 +++++++++---------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 039ece9d..90fb0af1 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -98,18 +98,6 @@ open class BarsIndicatorView: CarouselIndicator { ]) } - open override func layoutSubviews() { - super.layoutSubviews() - - if barReferences.isEmpty { - generateBars() - updateUI(previousIndex: previousIndex, - newIndex: currentIndex, - totalCount: numberOfPages, - isAnimated: false) - } - } - //-------------------------------------------------- // MARK: - Methods //-------------------------------------------------- @@ -154,6 +142,14 @@ open class BarsIndicatorView: CarouselIndicator { guard let model = model as? BarsCarouselIndicatorModel else { return } currentIndicatorColor = model.currentIndicatorColor.uiColor + + if barReferences.isEmpty { + generateBars() + updateUI(previousIndex: previousIndex, + newIndex: currentIndex, + totalCount: numberOfPages, + isAnimated: false) + } } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift index b4991d1e..e4ac2fe4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift @@ -66,17 +66,6 @@ open class NumericIndicatorView: CarouselIndicator { pageCount.updateView(size) } - open override func layoutSubviews() { - super.layoutSubviews() - - if pageCount.text?.isEmpty == nil { - updateUI(previousIndex: previousIndex, - newIndex: currentIndex, - totalCount: numberOfPages, - isAnimated: false) - } - } - //-------------------------------------------------- // MARK: - Setup //-------------------------------------------------- @@ -124,6 +113,17 @@ open class NumericIndicatorView: CarouselIndicator { leftArrow.setNeedsDisplay() } + open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { + super.set(with: model, delegateObject, additionalData) + + if pageCount.text?.isEmpty == nil { + updateUI(previousIndex: previousIndex, + newIndex: currentIndex, + totalCount: numberOfPages, + isAnimated: false) + } + } + //-------------------------------------------------- // MARK: - IndicatorViewProtocol //--------------------------------------------------