UIButton refactor for UILabel in storyboard
-
The UIButton actually contains a UILabel to display its titleLabel. Thus, you can set the button's UserInteractionEnabled: property to NO.
-
UIButton can have border color. So set the border color as pure color.
-
Make UIButton a custom type.
As you need to reconfigure constraints again, if you added labels, you can skip to the above solution.
Reason cannot change in IB / Storyboard:
You have dragged the UIButton from the library into your view. Even you try to change the class name to UILabel or its subclass, it won't change the class name.
because UILabel is just a UIView type, where UIButton is a UIControl type.
This is why you cannot change the UIButton class name for UILabel or UILabel subclass in IB.
Update:
No warranty / not recommended in Xcode release
source to share