Last active
January 4, 2021 14:35
-
-
Save kristopherjohnson/99783393889e6b3b9830 to your computer and use it in GitHub Desktop.
Swift: Custom UIButton subclass that displays a rounded rectangle in the background
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I improved the code a bit, and set it up for my use case.
You add this as a file to your project, and then in a Storyboard, while having selected an UIButton, you assign this class to it.
It then lets you change the Colors via the IB.
Paddings etc are messed up in the Storyboard if you use this, because it gets changed programatically. Works great though for me.