---
title: Day 33
author: Daniel Devesa Derksen-Staats
date: 2022-06-20 08:00
tags: VoiceOver, accessibilityValue, adjustable, iOS
categories: ["Accessibility"]
series: ["365 Days iOS Accessibility"]
image: /Images/365DaysIOSAccessibility/image170.jpg
---

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.

![A component lets you rate the Regency Cafe restaurant from one, to five thumbs up. It is currently at 5. It shows that swiping up will increase value and swiping down will decrease it. The code shows how you can override accessibility increment and decrement to adjust the accessibility value to something like "1 of 5".](/Images/365DaysIOSAccessibility/image170.jpg)

[Example code in the image:](https://gist.github.com/dadederk/1936a637c044a4519f959903653a25fc)

```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()](https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilityincrement%28%29)
* [accessibilitydecrement()](https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilitydecrement%28%29)
