I have a set of UIButtons
where each label is just a number. On each button of them, I set the background color to clear, there is no UIImage
set.
The problem is those buttons are only tappable on their label which makes it hard to tap.
I checked around for this problem and some solutions were to:
- change the content insets:
button.contentEdgeInsets = UIEdgeInsetsMake(-50, -50, -50, -50)
-> didn't change a thing - subclass UIButton and override
pointInside
-> didn't work,pointInside
was never reached when tapping on the button but outside the label.
I'm just surprised there is no easy solution for such a normal use case. I need the background clear as I am using those buttons for today's extension.
Any idea how I could do it?
EDIT:
Here is a sample project where I reproduced the problem.
It seems it's linked to static cell in a today extension as it's okay with static cell in a view controller within the app.