Skip to content

chore: refactor for easy subclassing and new features#8514

Merged
vtrifonov merged 1 commit into
NativeScript:masterfrom
Akylas:ios_textfiled_refactoring
Apr 10, 2020
Merged

chore: refactor for easy subclassing and new features#8514
vtrifonov merged 1 commit into
NativeScript:masterfrom
Akylas:ios_textfiled_refactoring

Conversation

@farfromrefug

Copy link
Copy Markdown
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