Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

how to do i enable autocorrection? #67

Closed
ghost opened this issue Jun 18, 2017 · 5 comments
Closed

how to do i enable autocorrection? #67

ghost opened this issue Jun 18, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2017

how to do i enable autocorrection?

@victorBaro
Copy link
Contributor

victorBaro commented Jun 22, 2017

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:

  1. Create your own TextInput. I'd suggest you use the provided ones, either AnimatedTextField or AnimatedTextView. Something like:
        let myInput = AnimatedTextField()
        myInput.clearButtonMode = .whileEditing
        myInput.keyboardType = .emailAddress
        myInput.autocorrectionType = .yes
  1. 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.

@ghost
Copy link
Author

ghost commented Jun 22, 2017

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.

@p4vlos
Copy link

p4vlos commented Jul 13, 2017

do you know if we can make this library available for iOS 10.0?

@victorBaro
Copy link
Contributor

@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

Tantalum73 added a commit to Tantalum73/AnimatedTextInput that referenced this issue Feb 19, 2018
By adressing issue jobandtalent#67, I added a property to set the UITextAutocorrectionType on the underlaying UITextField / UITextView.

Is is still turned off by default but the user now has the choice to turn it on.
@sunchengbo
Copy link

textAttributes How to use

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants