enableable stuff

This commit is contained in:
Kevin G Christiano 2020-05-05 13:00:26 -04:00
parent 89499d59ed
commit f7ba8da840

View File

@ -42,7 +42,6 @@ open class BarsIndicatorView: CarouselIndicator {
open override var isEnabled: Bool { open override var isEnabled: Bool {
didSet { didSet {
for (i, bar) in barReferences.enumerated() { for (i, bar) in barReferences.enumerated() {
if i == currentIndex { if i == currentIndex {
bar.view.backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor bar.view.backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor
@ -70,11 +69,13 @@ open class BarsIndicatorView: CarouselIndicator {
set (newColor) { set (newColor) {
super.indicatorColor = newColor super.indicatorColor = newColor
if isEnabled {
for (i, barTuple) in barReferences.enumerated() { for (i, barTuple) in barReferences.enumerated() {
barTuple.view.backgroundColor = i == currentIndex ? currentIndicatorColor : newColor barTuple.view.backgroundColor = i == currentIndex ? currentIndicatorColor : newColor
} }
} }
} }
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Setup // MARK: - Setup