Created
January 14, 2019 14:54
-
-
Save mecid/9f0aec4dacb667f956da2533035c2726 to your computer and use it in GitHub Desktop.
saccessibility5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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