Clicky

iOS Dev Nugget 75 UIButton Not Triggering Action

.

Need to run a code review on your codebase? Hire me

Sometimes, you'll have a UIButton (or a UIControl subclass) that doesn't trigger its action.

A quick tip! Check its frame and userInteractionEnabled property. If it looks good, check the parent's. Chances are one of them is either too small or userInteractionEnabled is set to NO.


Your feedback is valuable: Do you want more nuggets like this?   Yes   or   No

.

.

Like this and want such iOS dev nuggets to be emailed to you, weekly?

Sign Me Up! or follow @iosdevnuggets on Twitter

.

View archives of past issues