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

Allow disabling Done button #7

Closed
ZevEisenberg opened this issue Feb 3, 2016 · 6 comments
Closed

Allow disabling Done button #7

ZevEisenberg opened this issue Feb 3, 2016 · 6 comments

Comments

@ZevEisenberg
Copy link

The Done button should be able to be disabled, either based on delegate methods, a direct property, or a UITextField-like "auto-enable Return key" mode. In my use case, I'm using MMNumberKeyboard to fill in a single field, and I don't want the Go button to be enabled until the text field is non-empty.

@matmartinez
Copy link
Owner

Hello Zev, this would indeed make a great feature.

This is a tricky thing to do using the <UIKeyInput> protocol, because we'll need to observe changes made by the view itself (for example, the text could be changed by other code while the keyboard is active).

I'll investigate more about this and update the issue. Thanks!

@alfredcc
Copy link

How it's going?

@ZevEisenberg
Copy link
Author

Bump - @matmartinez I'd love to add this feature, but I don't see how to use UIKeyInput to get there. Do you have an idea of a starting point? I should be able to take it from there.

@matmartinez
Copy link
Owner

Hey guys! I'll try to understand how UIKit handles this internally with a dissembler. Will update this issue with the results :)

@matmartinez
Copy link
Owner

@ZevEisenberg finally solved this using the <UITextInputDelegate> protocol. This is not enabled by default, but it is quite simple to set up:

keyboard.enablesReturnKeyAutomatically = YES;

Cheers!

@ZevEisenberg
Copy link
Author

Hooray! 🎉

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

No branches or pull requests

3 participants