UISliders are adjustable, and its default accessibility value is represented in percentages. But that's not always the best format to express a value. Consider a slider to select a distance radius. Miles or km seem a more appropriate unit.

A slider is used to select a distance radius of 5 km. In code, the accessibilityValue property of the slider is updated using a Measurement Formatter to get the value as kilometres when the user interacts with the slider.

Example code in the image:

override var accessibilityValue: String? {
    get {
        let formatter = MeasurementFormatter()
        let measurement = Measurement(
          value: Double(value),
          unit: .kilometers
        )
        formatter.unitStyle = .long
        return formatter.string(from: measurement)
      }
    set {}
}

You may also find interesting...

Accessibility values are about state. Using them appropriately will make the experience better for Voice Control users. Think of a repeat button (values could be: off, one or all songs) or a notifications tab (value could be: x new items). For more on accessibility values, check out this fantastic blog post from @MobileA11y with info on the APIs (UIKit, SwiftUI), accessibility attributed values, WCAG, or some more examples (text in a text field, value on a stepper or slider). https://mobilea11y.com/blog/accessibility-values/

If you are developing a custom component, that can change value, chances are that it will need the adjustable accessibility trait (VoiceOver will say: "Adjustable"). Think of a component that lets you rate from one to five thumbs up (or stars).

Support both orientations, if possible. I know not even iOS itself does it, but it hasn't always been like that. You'll create a more robust UI that will be easier to port to iPadOS. And especially, don't force your users to rotate their devices.

Created in Swift with Ignite.

Supporting Swift for Swifts