5

If I create a UIButton in Storyboard and assign its Class to be a subclass I made (HighlightTappedButton), is there a way in the subclass to change the buttonType to Custom?

I know I can just change the type to Custom in storyboard, but I don't want to have to remember to do that every time.

Adam Johns
  • 35,397
  • 25
  • 123
  • 176

1 Answers1

3

I think it is not possible at runtime. Since it is a read-only method. I think you will get helpful questions from these links.

set UIButton's buttonType programmatically

Change UIButton type programatically

how to set UIButton type in UIButton Subclass

Community
  • 1
  • 1
Sudhin Davis
  • 2,010
  • 13
  • 18