2

I would like to have a separator between my two UITableViewRowActions. Here is an example of what I would like for my app to look like (this is from Fitbit's app):

Fitbit image

Here is what mine looks like:

My image

Here is my code for the actions:

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]
}

How can I achieve this separator? Thank you for your help.

Pranav Wadhwa
  • 7,666
  • 6
  • 39
  • 61

0 Answers0