In UIKit, to create an adjustable component we need to add the adjustable trait and override both accessibilityIncrement() and accessibilityDecrement(). In SwiftUI, everything you need is bundled in the accessibilityAdjustableAction(_:) modifier.

If you create a custom page indicator in SwiftUI, you can make it accessible in SwiftUI by using the .accessibilityAdjustableAction(_: ) modifier. In UIKit, you need three steps instead: add the .adjustable accessibility trait, override accessibilityIncrement(), and override accessibilityDecrement(). The code in SwiftUI is all in one place, the adjustable action modifier provides a closure with the direction of the action. You can use a switch to implement code for each one of the cases, in this case .increment, and .decrement.

You may also find interesting...

With VoiceOver, you can swipe up/down to increase/decrease the value of adjustable components. You need to implement accessibilityIncrement() and accessibilityDecrement() accordingly, and configure an accessibility value that makes sense. Example code in the image: ```swift override func accessibilityIncrement() { guard value < 5 else { return } value += 1 accessibilityValue = "\(value) of 5" sendActions(for: .valueChanged) } override func accessibilityDecrement() { guard value > 1 else { return } value -= 1 accessibilityValue = "\(value) of 5" sendActions(for: .valueChanged) } ``` Links to the official documentation: * accessibilityincrement() * accessibilitydecrement()

Sometimes, you may want to create a custom component, even if there is a similar one in UIKit because you want to style it in a way that the default one won't let you. That's fine, just take into account that you'll need to make it accessible.

If an image does not convey additional information, maybe it's just used to make the UI look more attractive, it makes sense for VoiceOver to skip it. UIKit: set isAccessibilityElement to false. SwiftUI: create a decorative image explicitly.

Created in Swift with Ignite.

Supporting Swift for Swifts