how to do i enable autocorrection?
opened this issue · comments
how to do i enable autocorrection?
It would be a nice addition. Currently it is a bit tricky.
Long story short:
AnimatedTextInput is a simple view that either contains a UITextView or UITextField (they implement TextInput
protocol) , depending on which type you need.
Each type defines its own configurator, that basically generates a textInput
(so again, either textview or textfield). This generated textInput is already set up (things like keyboardType, autocorrection, etc).
We also provide a type generic
that accepts your own textInput
.
So, in order to create your own textInput I'd suggest:
- Create your own
TextInput
. I'd suggest you use the provided ones, eitherAnimatedTextField
orAnimatedTextView
. Something like:
let myInput = AnimatedTextField()
myInput.clearButtonMode = .whileEditing
myInput.keyboardType = .emailAddress
myInput.autocorrectionType = .yes
- Provide your
textInput
to the animatedTextInput as generic type like so:
animatedTextInput.type = .generic(textInput: myInput)
Side note:
Should you use AnimatedTextField
or AnimatedTextView
?
Depends on your needs. For instance, textfields do not support multiline. Text views do not support secure text entry (for passwords).
The class AnimatedTextInput
is just a container of either of those 2 text inputs. It adds the placeholder animation and the bottom line look.
Im able to get the textview autocorrection now, but when I type the textview value does change. I know I can use textViewDidBeginEditing to update AnimatedTextInput().text but I didn't that should be necessary.
do you know if we can make this library available for iOS 10.0?
@pprevalon sorry I don't understand. What do you mean?
@p4vlos if your question is not related to this issue, feel free to open a new one. The library works with iOS10.0
textAttributes How to use