Skip to content

chore: refactor for easy subclassing and new features #8514

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

Merged
merged 1 commit into from
Apr 10, 2020

Conversation

farfromrefug
Copy link
Collaborator

This is a simple refactoring in the sense that now the intelligence of the UITextFieldDelegate is in the TextField class.

This is a really nice addition for plugin developers like me.
For example in nativescript-material-textfield i wanted to add a feature to limit digits that a textfield can accept.
This has to be handled in the delegate. Right now i have to rewrite and duplicate the whole delegate code from {N} to keep the feature of the {N} Textfield. It also means maintaining the delegate through {N} updates.

This makes it possible to simply "override" the delegate methods from your subclass of TextField

The only unknown there is, should those delegate functions be added in the typings

@cla-bot cla-bot bot added the cla: yes label Apr 9, 2020
@farfromrefug farfromrefug changed the title refactor for easy subclassing and new features chore: refactor for easy subclassing and new features Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants