Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rac_signalForControlEvents doesn't work on UILabels? Why? #407

Closed
zakdances opened this issue Mar 31, 2013 · 1 comment
Closed

rac_signalForControlEvents doesn't work on UILabels? Why? #407

zakdances opened this issue Mar 31, 2013 · 1 comment
Labels

Comments

@zakdances
Copy link

I'm a little confused as to what exactly I can assign a "UIControlEventTouchUpInside" action to. I get a "no visible interface" error for some elements, while others work. What are the limitations of signalForControlEvents? Shouldn't it be available for ALL UIViews and subclasses?

Secondary question: Is there a convenience macro for rac_signalForControlEvents or an easier syntax I should be using? (not that it isn't easy, I'm just wondering)

@jspahrsummers
Copy link
Member

I'm a little confused as to what exactly I can assign a "UIControlEventTouchUpInside" action to. I get a "no visible interface" error for some elements, while others work. What are the limitations of signalForControlEvents? Shouldn't it be available for ALL UIViews and subclasses?

No, it will only work for UIControl subclasses (which UILabel is not). It's a RACified version of UIKit's -addTarget:action:forControlEvents: method, nothing more.

Secondary question: Is there a convenience macro for rac_signalForControlEvents or an easier syntax I should be using? (not that it isn't easy, I'm just wondering)

Nope, nothing like that exists. It would be pretty difficult to simplify beyond what's there already.

@zakdances
Copy link
Author

Could RAC use UITapGestureRecognizer to attach touch-up events to various elements? This would be a great way to expand the functionality of rac_signalForControlEvents. If this is possible, I'd like to add this as a feature request. Currently I can't, for example, use rac_signalForControlEvents with a UIBarButtonItem because it doesn't inherit from UIButton.

@zakdances
Copy link
Author

I just noticed there are several other issues open for this same thing. Maybe I should close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants