0
我想在我的UITableViewController中實現滑動操作,但不顯示。UITableViewController中的滑動操作沒有出現在swift中
見我的代碼:
override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
}
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let keep = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Profiter"){(UITableViewRowAction,NSIndexPath) -> Void in
print("hello")
}
return [keep]
}
有了這些功能通常也適用於給編輯到一個UITableView。你在使用sectionIndexTitles嗎?這可以拋棄滑動操作位置,將它移動到sectionIndexTitles的左側而不是屏幕的左側。 – HalR