Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save giovani-pereira-ifood/57ce64ec602a0d77722abacee10c33f0 to your computer and use it in GitHub Desktop.
Save giovani-pereira-ifood/57ce64ec602a0d77722abacee10c33f0 to your computer and use it in GitHub Desktop.
How to add custom accessibility actions to a view
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