私は私の 2 つの間にセパレーターを持ちたいと思いUITableViewRowActions
ます。これは、私のアプリがどのように見えるかの例です (これは Fitbit のアプリからのものです):
これが私の外観です:
アクションのコードは次のとおりです。
override func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let delete = UITableViewRowAction(style: .Default, title: "Delete") { (action, indexPath) in
//Code for deleting
}
let edit = UITableViewRowAction(style: .Default, title: "Edit") { (action, indexPath) in
//Code for editing
}
edit.backgroundColor = UIColor(red: 0, green: 128/225, blue: 128/225, alpha: 1)
return [delete, edit]
}
どうすればこのセパレーターを実現できますか? ご協力ありがとうございました。