addressing layout issue

This commit is contained in:
Kevin G Christiano 2020-05-07 14:51:23 -04:00
parent 0501c2daae
commit ee107a25cf
2 changed files with 19 additions and 23 deletions

View File

@ -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)
}
}
//--------------------------------------------------

View File

@ -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
//--------------------------------------------------