79247443

Date: 2024-12-03 11:49:18
Score: 0.5
Natty:
Report link

When setting the userInteraction property, also add/remove .notEnabled accessibility trait for that view

func disable() {
    view.isUserInteractionEnabled = false
    view.accessibilityTraits.insert(.notEnabled)
}

func enable() {
    view.isUserInteractionEnabled = true
    view.accessibilityTraits.remove(.notEnabled)
}
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When
  • Low reputation (0.5):
Posted by: ikroop