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