我想在我的两个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]
}
如何实现此分隔符?谢谢你的帮助。