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

RACCommand support for UIButton #404

Closed
joshaber opened this issue Mar 27, 2013 · 7 comments
Closed

RACCommand support for UIButton #404

joshaber opened this issue Mar 27, 2013 · 7 comments

Comments

@joshaber
Copy link
Member

No description provided.

@jspahrsummers
Copy link
Member

Does this mean only touch up inside events?

@jspahrsummers
Copy link
Member

Also, what about controls like UITextField? This seems hard to do generically.

@joshaber
Copy link
Member Author

Maybe just UIButton, then? On touch up inside.

@KyleLeneau
Copy link
Contributor

Wouldn't this be similar to using rac_signalForControlEvents: Or does this mean binding to the the enabled property on the control? I wanted this for UIBarButtonItem which would just hijack the action and prevent execution until canExecute is YES.

@joshaber
Copy link
Member Author

Or does this mean binding to the the enabled property on the control?

Yep, exactly. I created another issue for UIBarButtonItem (#403).

@kouky
Copy link

kouky commented May 6, 2013

Given there is no current rac_command property for a UIButton would the correct approach be to raise a signal on UIControlEventTouchUpInside?

RACSignal *submit = [self.submitButton rac_signalForControlEvents:UIControlEventTouchUpInside];
[submit subscribeNext:^(id sender) {
    NSLog(@"button was pressed!");
}];

@joshaber
Copy link
Member Author

joshaber commented May 7, 2013

Yep, that'd work. You could even do:

[[self.submitButton rac_signalForControlEvents:UIControlEventTouchUpInside] executeCommand:command];

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

No branches or pull requests

4 participants