thinkswift
thinkswift

Reputation: 528

Core Graphics button. Best practice please

I have now learned to add core graphics as subviews. Looks gorgeous and 2x independent. I haven't found a tutorial on Core Graphics Button with action for Swift. First thing that came in mind is that I simply draw graphics and then make transparent buttons on top of them, but I am sure it is not the correct way and I want to change some button design properties based on events, like ifpressed ifloggedin etc.

What would be the standard or best practice on doing custom core graphics as buttons in Swift. Any code examples welcome. Thank you!

Upvotes: 0

Views: 329

Answers (1)

Daij-Djan
Daij-Djan

Reputation: 50129

subclass UIButton and provide a custom drawRect implementation

Upvotes: 2

Related Questions