I use the following code
let deleteAction =
UIContextualAction(style: .normal, title: ""){ (action, sourceView, completionHandler) in
self.dataManager.items.remove(at: indexPath.row)
self.itemCardTableView.deleteRows(at: [indexPath], with: .automatic)
completionHandler(true)
}
let deleteResize = #imageLiteral(resourceName: "delete72").resizeImage(withSize: CGSize(width: 50, height: 50), scaleMode: .contentAspectFill)
deleteAction.backgroundColor = UIColor.white
deleteAction.backgroundColor = UIColor(patternImage: deleteResize!)
image is repeated. This is not what I want
https://i.stack.imgur.com/xUUWY.png
I want is like this
https://i.stack.imgur.com/CV5DX.png
How to fix it