Skip to content

Conversation

@natanrolnik
Copy link
Contributor

Recently, I've came accross the (not so) new UIControl.Event.primaryActionTriggered available since iOS 9.

Although the documentation I could find doesn't describe enough about it, this book says the following:

Starting in iOS 9, a control also has a primary control event, a UIControlEvent called .primaryActionTriggered. The primary control event is Value Changed for all controls except for UIButton, where it is Touch Up Inside, and UITextField, where it is Did End On Exit.

I believe that TORoundedButton should behave like a UIButton, and this PR adds this subtle change. It hooks up on the .touchUpInside action to fire the actions registered on .primaryActionTriggered. Although I couldn't find a way for a UIControl subclass to override/change the primary action, this solution adds this capability to TORoundedButton.

@TimOliver
Copy link
Owner

Oh nice! I had no idea that existed! Thanks a lot! :)

@TimOliver TimOliver merged commit 14f1268 into TimOliver:master May 14, 2019
@natanrolnik natanrolnik deleted the patch-1 branch May 14, 2019 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants