DK
Вчера пол дня искал решение, написал в чат – через 5 минут сам понял. Спасибо чат!
Size: a a a
DK
AO
Х
DK
DK
Х
Х
l
ВК
l
DK
l
В
ВК
func tableView(
_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath)
{
let verticalPadding: CGFloat = 8
let maskLayer = CALayer()
maskLayer.cornerRadius = 10
//if you want round edges
maskLayer.backgroundColor = UIColor.black.cgColor
maskLayer.frame = CGRect(x: cell.bounds.origin.x, y: cell.bounds.origin.y, width: cell.bounds.width, height: cell.bounds.height).insetBy(dx: 0, dy: verticalPadding/5)
cell.layer.mask = maskLayer
}
override
func tableView(
_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return
true
}
override
func tableView(
_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
let action = UIContextualAction(style: .normal, title: "volume", handler: { (action,view,completionHandler )
in
//do stuff
completionHandler(
true)
})
let stack = UIContextualAction(style: .normal, title: "Stack", handler: { (action,view,completionHandler )
in
//do stuff
completionHandler(
true)
})
stack.backgroundColor = colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1)
stack.image = UIImage(systemName: "text.badge.plus")
action.image = UIImage(systemName: "speaker.slash")
action.backgroundColor = .red
let configuration = UISwipeActionsConfiguration(actions: [action,stack])
return configuration
}
В
для слабаков, код в сообщение для пацанов.DK