Skip to content

Instantly share code, notes, and snippets.

@mecid
Created January 14, 2019 14:54
Show Gist options
  • Save mecid/9f0aec4dacb667f956da2533035c2726 to your computer and use it in GitHub Desktop.
Save mecid/9f0aec4dacb667f956da2533035c2726 to your computer and use it in GitHub Desktop.
saccessibility5
import UIKit
class RatingView: UIView {
private(set) var value: Int = 1
override var accessibilityTraits: UIAccessibilityTraits {
get { return .adjustable }
set {}
}
override var accessibilityLabel: String? {
get { return "Rating" }
set {}
}
override var accessibilityValue: String? {
get { return String(value) }
set {}
}
override func accessibilityIncrement() {
value += 1
}
override func accessibilityDecrement() {
value -= 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment