diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index be3b3542..d1f12d85 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -197,7 +197,7 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { currentIndex = model.currentIndex isEnabled = model.enabled - adjustAccessibilityValue(of: currentIndex + 1, total: numberOfPages) + formatAccessibilityValue(index: currentIndex + 1, total: numberOfPages) } //-------------------------------------------------- @@ -206,15 +206,15 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { open override func accessibilityIncrement() { - accessibilityAdjust(toPage: currentIndex + 1) + adjustAccessibility(toPage: currentIndex + 1) } open override func accessibilityDecrement() { - accessibilityAdjust(toPage: currentIndex - 1) + adjustAccessibility(toPage: currentIndex - 1) } - func adjustAccessibilityValue(of index: Int, total: Int) { + func formatAccessibilityValue(index: Int, total: Int) { let ordinalFormatter = NumberFormatter() ordinalFormatter.numberStyle = .ordinal @@ -226,9 +226,9 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { accessibilityValue = String(format: accessibleFormat, accessibleIndex, total) } - func accessibilityAdjust(toPage index: Int) { + func adjustAccessibility(toPage index: Int) { - adjustAccessibilityValue(of: index, total: numberOfPages) + formatAccessibilityValue(index: index, total: numberOfPages) if (index < numberOfPages && index >= 0) || carouselIndicatorModel?.alwaysSendAction ?? false { carouselIndicatorModel?.animated = false diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift index 8660968d..3585be05 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift @@ -120,7 +120,7 @@ open class NumericIndicatorView: CarouselIndicator { open override func updateUI(previousIndex oldIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) { pageCount.text = "\(newIndex + 1)/\(totalCount)" - adjustAccessibilityValue(of: newIndex + 1, total: totalCount) + formatAccessibilityValue(index: newIndex + 1, total: totalCount) layoutIfNeeded() } }