1
UIContextualActionの実行中と実行後にUITableViewCellのテキストを取り消すにはどうすればよいですか?途中で途切れたUITableViewCellテキストフィールド "完了"
func tableView(_ tableView: UITableView,
leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration?
{
let doneAction = UIContextualAction(style: .normal, title: "DONE", handler: { (ac:UIContextualAction, view:UIView, success:(Bool) -> Void) in
print("Done left")
self.dailyTasks.append("\(self.dailyTasks[indexPath.row])")
self.dailyTasks.remove(at: indexPath.row)
UserDefaults.standard.set(self.dailyTasks, forKey: "dailyTasks")
self.dailyTable.reloadData()
success(true)
})
doneAction.backgroundColor = .darkGray
return UISwipeActionsConfiguration(actions: [doneAction])
}
@ahmedありがとうございました。私は次のようにそれぞれのセルを得ることができました: let cell = self.dailyTable.dequeueReusableCell(withIdentifier: "Cell"、for:indexPath) – reinho14