5

I am looking for a way where in UITextView autocorrection should not happen but prediction above keyboard should appear when user types. Is this possible?

Autocorrection can be disabled using below snippet which disables prediction also:

textfield.autocorrectionType = UITextAutocorrectionTypeNo;
Arun Gupta
  • 2,628
  • 1
  • 20
  • 37
  • Possible duplicate http://stackoverflow.com/questions/3802389/how-to-disable-text-autocorrection-for-an-uitextfield-or-keyboard – radioaktiv Feb 25 '16 at 14:56
  • Please read the question carefully. I know how to disable autocorrection. I am looking for answer where autocorrection is disabled but prediction still appears. – Arun Gupta Feb 25 '16 at 14:58
  • Why a vote down is given on the question. I didn't find any answer on this which let me here. – Arun Gupta Feb 25 '16 at 15:41
  • Another possible duplicate http://stackoverflow.com/questions/25767522/disable-uitextfield-predictive-text – radioaktiv Feb 25 '16 at 21:12
  • Did you find your answer in the link above ? – radioaktiv Feb 26 '16 at 09:07
  • No @radioaktiv. Setting autocorrectionType to UITextAutocorrectionTypeNo will disable both predictive Text as well autocorrection of text. As looking for something where autocorrection of text is disable but text prediction should be enabled. Example when i start writing advertizing it should suggest the words above keyboard (prediction) but it should not autocorrect the text to advertising automatically. – Arun Gupta Feb 26 '16 at 09:13
  • 1
    Have you found the answer yet? The Facebook app could do this. I don't know why. :( – Danh Huynh Aug 15 '19 at 02:44

1 Answers1

2

Try with :

  textfield.spellCheckingType = UITextSpellCheckingTypeNo;
radioaktiv
  • 2,437
  • 4
  • 27
  • 36
  • ansTextField.autocorrectionType = UITextAutocorrectionTypeYes; ansTextField.spellCheckingType = UITextSpellCheckingTypeNo; i have this two already set in my code. This gives prediction as well as autocorrect the word – Arun Gupta Feb 29 '16 at 10:06
  • Since you dont want autocorrection why do you have ansTextField.autocorrectionType = UITextAutocorrectionTypeYes; ? – radioaktiv Feb 29 '16 at 12:59
  • I have tried all 4 combination with autocorrection and spellchecking. If i set autocorrection to NO then autocorrection doesn't happens and prediction also is disabled and if i set it to Yes then prediction as well as autocorrection happens. Spellchecking has no effect. – Arun Gupta Feb 29 '16 at 13:37
  • 1
    The question asked here is valid and still no answers for it! Surprising. I too need an answer for it. – Shobhit C Jul 10 '18 at 14:34