I'm trying to set UIView's accessibilityIdentifier...
# ios
d
I'm trying to set UIView's accessibilityIdentifier property, but it's not recognized by the Kotlin native compiler for either example 1 or 2 below. Any help in how I might set the accessibilityIdentifier property via Kotlin would help me greatly. I'm happy to add custom OBJ-C bindings, but I would appreciate help being pointed to a tutorial to learn how to do so. Any help would be very appreciated. Example 1:
Copy code
class MyView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.accessibilityIdentifier = "my-custom-view"
    }
}
Example 2:
Copy code
val view: UILabel = ...
view.accessibilityIdentifier = "my-custom-view"
l
It looks like accessibilityIdentifier is part of
UIAccessibilityIdentificationProtocol
in Kotlin, which UIView does not implement by default.
d
Workaround found. Details in YouTrack: https://youtrack.jetbrains.com/issue/KT-53331