I have a UITableView with simple content:
The user can edit (delete) the cells when tapping the Edit button the standard way.
I need to change TextLabel from "Edit" to "Done" when the user clicked on "Edit" button.
@IBAction func editButtonPressed(_ sender: UIButton) {
tableView.isEditing = !tableView.isEditing
if tableView.isEditing {
editButton.titleLabel?.text = "Done"
} else {
editButton.titleLabel?.text = "Edit"
}
}
TitleLabel doesn't change. I need change titleLabel to "Done" when I the user pressed "Edit"