For the swipe action you use the UIContextualAction in this animation is default. Here are example Following code you need to write in UITableView delegate method. Delegate method name: trailingSwipeActionsConfigurationForRowAt let action = UIContextualAction(style: .destructive, title: nil) { (action, view, completion) in print("Delete action") completion(true) // Handle completion after performing action } action.backgroundColor = ColorManager.primaryColor action.image = UIImage(named: ImageManager.icon_delete) // Create swipe actions configuration let swipeConfig = UISwipeActionsConfiguration(actions: [action]) swipeConfig.performsFirstActionWithFullSwipe = false return swipeConfig
Just what i was looking for!! amazing!! when you delete the cell, How do you make it disappear with animation?
For the swipe action you use the UIContextualAction in this animation is default.
Here are example
Following code you need to write in UITableView delegate method.
Delegate method name: trailingSwipeActionsConfigurationForRowAt
let action = UIContextualAction(style: .destructive, title: nil) { (action, view, completion) in
print("Delete action")
completion(true) // Handle completion after performing action
}
action.backgroundColor = ColorManager.primaryColor
action.image = UIImage(named: ImageManager.icon_delete)
// Create swipe actions configuration
let swipeConfig = UISwipeActionsConfiguration(actions: [action])
swipeConfig.performsFirstActionWithFullSwipe = false
return swipeConfig
@@SoftwareDevelopment13 Thanks you!!!