I am trying to use the UIView that I created on the Storyboard as a button. I suggested that it would be possible to use UIButton by setting the type to custom. However, I was unable to add subviews to the custom UIButton in the Storyboard.
As such, I just spent the last hour inventing the wheel, making my own custom gesture redesigners to redefine the functionality of the buttons.
Of course, this is not the best way to do this, so my question is for more experienced iOS developers than me - is this the best way to create a custom button?
To be clear, he must:
- Use the UIView that I created as the hittable scope.
- You can show a different state depending on whether it is currently highlighted or not (i.e., touch).
- Follow some steps when actually pressed.
Thank you for your help.
source share