Autocomplete feature only
bribar opened this issue · comments
Hi Ryan,
Love the functionality of the autocomplete! I'm looking for a way to apply the autocomplete feature to a UITextView without all the other goodies.
Example, add a UITextView to a storyboard ViewController and apply the autocomplete feature alone, by adding a custom class to the UITextView or however you suggest. Do you have any examples of this or point me in the right direction?
Thanks for the help!
@bribar I implemented an autocomplete manager for my project. It binds to a UITextView. You could use it as a starting point! https://github.com/nathantannar4/InputBarAccessoryView/tree/master/InputBarAccessoryView/Plugins/AutocompleteManager
Sent with GitHawk
@nathantannar4 Nice work! After reviewing... I didn't notice any optional protocols to capture the autocomplete selected (or typed completely) and also if removed. I looked through the protocols for AutocompleteManager and InputBar. Am I missing something or do I have to handle this myself?
Thanks bro!
Use shouldUnregister
to let you know if an autocomplete session is about to be destroyed, and shouldComplete
for when someone has tapped on an autocomplete cell and wants to complete it. The text they have currently entered will be in the AutocompleteSession
objects filter String property
Sent with GitHawk
Ahhh, I felt like I was close...knew it was something with the session. Thanks!
@nathantannar4 Using your example project... this is the output I get
Tried to access manager.currentSession
as the optional in image above. The text
parameter is empty in shouldComplete
Maybe I'm not understanding the last line of your comment?
@bribar Could you please open a new issue on the InputBarAccessoryView project? For clarity, it would help to keep the discussion only related to the MessageViewControlelr library
Sure thing!