UITableViewControllerでスワイプアクションを実装したいが表示されない。UITableViewControllerのスワイプアクションがスウィフトに表示されない
は私のコードを参照してください:
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]
}
は、これらの機能を持って使用するようにしてください。 sectionIndexTitlesを使用していますか?これにより、スワイプのアクション位置がスクロールされ、画面の左側の代わりにsectionIndexTitlesの左に移動されます。 – HalR