【问题标题】:how to add a delete button in a table view cell in IOS swift [duplicate]如何在IOS swift中的表格视图单元格中添加删除按钮[重复]
【发布时间】:2016-12-27 08:21:30
【问题描述】:

我正在快速处理 tableview 单元格,我想使用删除按钮删除特定单元格。我尝试通过storyboard 按下按钮,但它不起作用。

我能为它做些什么?

【问题讨论】:

标签: ios swift uitableview


【解决方案1】:

为tableview试试这个方法::

func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath)
    {
        if editingStyle == .Delete
        {
         //code for delete
        }
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-10
    • 2018-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多