Auto resizing a pdf. icon image in the UIContextualAction.image doesnt seem to be working

96 Views Asked by At
    delete.image = UIGraphicsImageRenderer(size: CGSize(width: 28, height: 28)).image(actions: { (_) in

        UIImage(named: "Trash Icon")?.draw(in: CGRect(x: 0, y: 0, width: 28, height: 28))

    })

With CGRect, the .pdf icon is stretch and does not retain its aspect ratio, is there any way to "draw" in aspect fit mode?

0

There are 0 best solutions below