Git Hub
коротко

Custom action in UITableViewCell

15 июня 2017, 23:59

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
       
        let share = UITableViewRowAction(style: .normal, title: "Share") { action, index in
            print("share button tapped")
        }
        share.backgroundColor = UIColor.blue
        
        let deleteAction = UITableViewRowAction(style: .default, title: "Del") {action, index in
            self.deleteRow(index)
        }
        
        deleteAction.backgroundColor = .red
        return [deleteAction, share]
    }
Поделиться
Ctrl
Популярное