From c7e3fd189a25112aadc1fcf72ff7c7929c1adef1 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Fri, 1 May 2020 16:56:21 -0400 Subject: [PATCH] accessibility revision for numeric. --- .../CarouselIndicator/NumericIndicatorView.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift index bf090066..bfe247f5 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/NumericIndicatorView.swift @@ -83,8 +83,8 @@ open class NumericIndicatorView: CarouselIndicator { open override func setupView() { super.setupView() - isUserInteractionEnabled = false - isAccessibilityElement = false + isAccessibilityElement = true + accessibilityTraits = .adjustable addSubview(pageCount) addSubview(leftArrow) addSubview(rightArrow) @@ -101,7 +101,7 @@ open class NumericIndicatorView: CarouselIndicator { trailingAnchor.constraint(equalTo: rightArrow.trailingAnchor) ]) - accessibilityElements = [leftArrow, pageCount, rightArrow] + // accessibilityElements = [leftArrow, pageCount, rightArrow] } public override func assessTouchOf(_ touchPoint_X: CGFloat) { @@ -123,4 +123,12 @@ open class NumericIndicatorView: CarouselIndicator { pageCount.accessibilityValue = "Page \(newIndex + 1) of \(totalCount)" layoutIfNeeded() } + + open override func accessibilityIncrement() { + incrementCurrentIndex() + } + + open override func accessibilityDecrement() { + decrementCurrentIndex() + } }