2
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
if condition == true {
let pause = UITableViewRowAction(style: .Destructive, title: "pause") { action, index in
print("pause button tapped")
return [pause]
}
} else {
return .None
}
}
このコードはセル内でスワイプすることはできませんでした。しかし、セルをスワイプすると、削除オプションが表示されます。誰もがこの問題をスローするのを助けることができます。条件が偽である場合、tableView内のセルをスワイプするのを無効にしますか?
http://stackoverflow.com/questions/34550291/disable-cell-swipe-action –