SlackTextViewController icon indicating copy to clipboard operation
SlackTextViewController copied to clipboard

typingSuggestionEnabled does not keep predictive QuickType bar hidden

Open ghost opened this issue 8 years ago • 3 comments

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

ghost avatar Mar 01 '16 16:03 ghost

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?

dzenbot avatar Mar 03 '16 10:03 dzenbot

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).

FreshDonut avatar Mar 18 '16 00:03 FreshDonut

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.

EddyVerbruggen avatar Oct 28 '16 12:10 EddyVerbruggen