Comments (4)
Hey @AlexisQapa, thanks for your question.
I'm on a short vacation right now, unfortunately.
I'll be able to add UITextView
support early next week. I suppose this new module to be quite similar to the current UITextFieldDelegate
implementation in our library, so it shouldn't take long.
Stay tuned for upcoming updates!
from input-mask-ios.
I've been playing a bit with it and I got it working. It's mostly changing methods signatures except for two things that will need discussion :
-
there is no clear button so : textViewShouldClear(_ textView: UITextView) -> Bool is useless. Maybe you could keep it somehow so if one add a clear button he can get the same behaviour.
-
the done button input a newline instead of delegating keyboard dismissal. You could add a toggle with something like :
open func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { // Hack to detect enter key if toggle { let resultRange = text.rangeOfCharacter(from: .newlines, options: .backwards) if text.count == 1 && resultRange?.lowerBound != nil { textView.resignFirstResponder() return false } } ...
in order to have the same behaviour as for the TextField but keep it optin as it's mostly a hack and ppl may want to input newLines.
Finally, you may want to have only one delegate class, so maybe a wrapper or the listener could implement UITextFieldDelegate and UITextViewDelegate
from input-mask-ios.
@AlexisQapa, thanks for your comments, you pretty much described the final solution.
Future UITextFieldDelegate
and UITextViewDelegate
objects are expected to contain lots of common logic, which brings us to the obvious need of refactoring. Repetitive code is not an option.
Though we've got a minor backward compatibility issue, as our current library listener is called a MaskedTextFieldDelegate
, and I've got to retain this TextFieldDelegate naming in order to avoid breaking things. Thus, I'll need to consider a gradual refactoring or something. Nevertheless, there's nothing to be concerned about. Will see next week.
from input-mask-ios.
Implemented in 3.5.0
.
from input-mask-ios.
Related Issues (20)
- can you add tailplaceholder as parameter, like MaskedTexfieldDelegate(primaryFormat: [99] / [99], isTailPlaceholderVisible: true) HOT 3
- Move the list of countries to an external file⦠maybe?
- fix put when primaryMaskFormat "7 ([999])", if we use put("788", textfield) and if string first char is 7 mask will remove it, output: "7 88" HOT 8
- Update the wikis
- Obtain text field value without input-mask HOT 1
- first number of format is wrong with prefix HOT 2
- Being able to use the `UITextField` delegates HOT 11
- First number of mask(#104) HOT 17
- Automatic Caps Lock Activation Issue in MaskedTextField HOT 7
- [Question] How do I initially fill in the mask having only symbols for blanks? HOT 10
- [Question] Character Limit HOT 2
- IOS Objective-C Programmatically example HOT 1
- [!] Unable to determine Swift version for the following pods HOT 1
- Unable to use with single textField HOT 2
- How to define ${dynamic amount }/month in input mask HOT 1
- How to write uppercased text? HOT 2
- Number Formatting (Thousand Separator) HOT 3
- Poor performance when user types fast HOT 3
- can you make mask template always visible while user input text HOT 2
- My repo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from input-mask-ios.