How to programmatically draw an image for a UIButton, instead of passing it as a static resource?
Subclassing UIButton and overriding drawRect method causes the button to loose Tint behavior and possible other drawing effects too. Calling super.drawRect does not restore those behaviors.
I found an solution of my own. Drawing it into an
UIImageand pass it to the button as a background image for normal state allows to dynamically create an image and preserves theUIButtoneffects.