반응형
📄 Add swipe to delete UITableViewCell Source Code by Swift
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return true
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if (editingStyle == .delete) {
// handle delete (by removing the data from your array and updating the tableview)
}
}
🚀 REFERENCE
Add swipe to delete UITableViewCell
I am making a CheckList application with a UITableView. I was wondering how to add a swipe to delete a UITableViewCell. This is my ViewController.swift: import UIKit class ViewController:
stackoverflow.com
반응형
댓글