Creating a custom button using CALayer

What is the best way to achieve the next. enter image description here

Basically I want to create an "unresolvable area" where the user can touch and follow up. For example, in the picture, the user takes the green zone, and the pop - with some options. Likewise, there would be different colors for the "hard-to-solve areas or buttons" in this slice of pizza, if you can.

I was thinking about creating buttons created with CALayer and trying to fit them into the frames of an empty state image, but I don't know how. Any other ideas are well appreciated. Empty state of the pizza slice

+3


source to share


1 answer


I would subclass UIButton

or UIControl

to create your custom button. Then override pointInside:withEvent:

to see if the touch event is in the correct area.

See these links for more information and ideas:



+1


source







All Articles