Last active
April 29, 2021 11:56
-
-
Save giovani-pereira-ifood/57ce64ec602a0d77722abacee10c33f0 to your computer and use it in GitHub Desktop.
How to add custom accessibility actions to a view
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
func configureAccessibility() { | |
isAccessibilityElement = true | |
let deleteAction = UIAccessibilityCustomAction( | |
name: "delete", | |
target: self, | |
selector: #selector(didTouchDeleteListAction) | |
) | |
let selectAction = UIAccessibilityCustomAction( | |
name: "select", | |
target: self, | |
selector: #selector(didTouchSelectListAction) | |
) | |
let editAction = UIAccessibilityCustomAction( | |
name: "edit", | |
target: self, | |
selector: #selector(didTouchEditListAction) | |
) | |
accessibilityCustomActions = [ | |
selectAction, | |
deleteAction, | |
editAction | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment