Created
October 15, 2025 11:33
-
-
Save kristofk/1c514593d2ea5a63a14e960c99d32d4a to your computer and use it in GitHub Desktop.
Overwrite UIAccessibility properties for easier control and debugging
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
| var _accessibilityLabel: String? = "" | |
| override var accessibilityLabel: String? { | |
| get { | |
| _accessibilityLabel | |
| } | |
| set { | |
| print("[x] accessibilityValue: [\(_accessibilityLabel ?? "nil")] => [\(newValue ?? "nil")]") | |
| _accessibilityLabel = newValue | |
| } | |
| } | |
| var _accessibilityValue: String? = "" | |
| override var accessibilityValue: String? { | |
| get { | |
| _accessibilityValue | |
| } | |
| set { | |
| print("[x] accessibilityValue: [\(_accessibilityValue ?? "nil")] => [\(newValue ?? "nil")]") | |
| _accessibilityValue = newValue | |
| } | |
| } | |
| var _accessibilityHint: String? = "" | |
| override var accessibilityHint: String? { | |
| get { | |
| _accessibilityHint | |
| } | |
| set { | |
| print("[x] accessibilityHint: [\(_accessibilityHint ?? "nil")] => [\(newValue ?? "nil")]") | |
| _accessibilityHint = newValue | |
| } | |
| } | |
| var _isAccessibilityElement: Bool = true | |
| override var isAccessibilityElement: Bool { | |
| get { | |
| _isAccessibilityElement | |
| } | |
| set { | |
| print("[x] isAccessibilityElement: [\(_isAccessibilityElement)] => [\(newValue)]") | |
| _isAccessibilityElement = newValue | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment