Component - Swipe actions
This UI component allows users to swipe a list item left or right to reveal quick action buttons like Delete or Edit. It improves usability by letting users perform common tasks directly from the list.
This UI component allows users to swipe a list item left or right to reveal quick action buttons like Delete or Edit. It improves usability by letting users perform common tasks directly from the list.
UITableView
└── UITableViewCell
├── ContentView
│ └── UILabel (Item title)
└── SwipeActions
├── LeadingSwipeActionsConfiguration (optional)
└── TrailingSwipeActionsConfigurationUIContextualAction in a swipe action on iOS?UIContextualAction for a swipe action in Swift?let deleteAction = UIContextualAction(style: .destructive, title: "Delete") { _, _, completionHandler in
print("Deleted")
completionHandler(true)
}
let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
return configurationlet editAction = UIContextualAction(style: .normal, title: "Edit") { action, view, _ in
print("Edit tapped")
}Pass the test and this pattern moves unknown