Customizing UIContextualAction Shapes

Hi


Some applications when swapping its table cells they shows the actions buttons thats revealed as circle not the default square shape, haw this can be done ?

--

Kindest Regards

Answered by Claude31 in 414711022

Just add an image to the action with the circle of your choice:


        let taken = UIContextualAction(style: .normal, title: "Taken") { (action, view, completion) in
            print("Just Swiped Taken", action)
            completion(true)
        }
        taken.backgroundColor =  UIColor(red: 0.5725490451, green: 0, blue: 0.2313725501, alpha: 1)
        taken.image = UIImage(named: "Round Image")
Accepted Answer

Just add an image to the action with the circle of your choice:


        let taken = UIContextualAction(style: .normal, title: "Taken") { (action, view, completion) in
            print("Just Swiped Taken", action)
            completion(true)
        }
        taken.backgroundColor =  UIColor(red: 0.5725490451, green: 0, blue: 0.2313725501, alpha: 1)
        taken.image = UIImage(named: "Round Image")

Thanks Allot

Customizing UIContextualAction Shapes
 
 
Q