func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]?
{
let delete = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Delete" , handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
//Do something
})
delete.backgroundColor = UIColor.redColor()
let more = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "More" , handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in
//Do something
})
more.backgroundColor = UIColor.blueColor()
return [delete, more]
}
を使用しています私はまた
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
// you need to implement this method too or you can't swipe to display the actions
}
func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
// the cells you would like the actions to appear needs to be editable
return true
}
を含めて、私は私が表示されない作成し、右または左のボタンをスワイプするとき。私はeditactionforrowatindexpathにオーバーライドを入れようとしましたが、メソッドがスーパークラスのメソッドをオーバーライドしないというエラーが発生しました
をドラッグすることで、デリゲートとデータソースメソッドを接続する必要があるが、ブレークポイントを入れて、機能が 呼び出されたりされていないことを確認しますか?あなたの代理人が正しく設定されているかどうかチェックしてください! – Pushp
私はuitableviewdelegateとuitabledatasourceを使用していますが、その機能が呼び出されていないのはわかりませんなぜ@Pushp –
あなたはすでに設定していますか?そうであれば ?それからどう? programeticallyまたはstoryboadrdを使用して? – Pushp