【发布时间】:2016-08-05 05:10:05
【问题描述】:
假设表格视图单元格中有 10 行,如果滑动任何行并且在按下编辑操作字段后变为可编辑并且剩余的行滑动应该被禁用。
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]?
{
/*to perform edit action on row*/
let edit = UITableViewRowAction(style: UITableViewRowActionStyle.Normal, title: "Edit"){(UITableViewRowAction,NSIndexPath) -> Void in
let cell:SuppliersCutomTableViewCell = tableView.cellForRowAtIndexPath(indexPath) as! SuppliersCutomTableViewCell
print("indexPath",indexPath)
/*making Field Editable method*/
cell.textFieldedit()
}
edit.backgroundColor = UIColor(red: 0.298, green: 0.851, blue: 0.3922, alpha: 1.0);
return [edit]
}
【问题讨论】:
标签: ios swift xcode tableviewcell