Last active
November 2, 2017 12:10
-
-
Save pgpt10/ce43a3a802bbe85168331b342bae02c3 to your computer and use it in GitHub Desktop.
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
@available(iOS 11.0, *) | |
func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? | |
{ | |
let deleteAction = UIContextualAction(style: .destructive, title: "Add") { (action, view, handler) in | |
print("Add Action Tapped") | |
} | |
deleteAction.backgroundColor = .green | |
let configuration = UISwipeActionsConfiguration(actions: [deleteAction]) | |
return configuration | |
} | |
@available(iOS 11.0, *) | |
func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? | |
{ | |
let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { (action, view, handler) in | |
print("Delete Action Tapped") | |
} | |
deleteAction.backgroundColor = .red | |
let configuration = UISwipeActionsConfiguration(actions: [deleteAction]) | |
return configuration | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment