SlackTextViewController
SlackTextViewController copied to clipboard
typingSuggestionEnabled does not keep predictive QuickType bar hidden
In the swift example code simply adding self.textView.typingSuggestionEnabled = false
in configureViews()
hides the predictive text but as soon as you start typing the bar pops back into view.
This is Xcode 7.2.1 and iOS 9.2
That is a bug. It has been like that for quite some time probably.
This is because, internally, in SLKTextViewController
this method is called regularly when the text changes in the textView
. The typingSuggestionEnabled
feature was mainly used to disable auto-correction when the auto-completion mode was on.
What you want to achieve is to disable the typing suggestion forever then?
It would be nice if this could be forever. I tried doing so by also setting it to NO
in textViewDidBeginEditing:(UITextView *)textView
, but that really messed up performance when typing.
The reason I would like to hide it is because I'm already showing a toolbar in addition to the one in this controller resulting in a lot of space being taken up when the user is typing (Think Facebook Messenger).
Ran into the same thing and what worked for me was doing this in the (ObjC) class extending SLKTextViewController
:
self.textView.autocorrectionType = UITextAutocorrectionTypeNo;
UPDATE: Hmm, that's because of a bug in iOS 10.x beta I'm afraid (the log is filled with errors related to the required dictionary).. my iOS 9 device isn't helped by this LoC.\
UPDATE 2:
Seems like the only current way (I'd love to be wrong here!) is setting self.textView.secureTextEntry = YES;
. The downside is that it'll also disable the Emoji keyboard so it's not for everyone.