Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UITextViews #3

Open
fatuhoku opened this issue Jul 21, 2014 · 2 comments
Open

Support UITextViews #3

fatuhoku opened this issue Jul 21, 2014 · 2 comments

Comments

@fatuhoku
Copy link
Contributor

TOMSSuggestionBar doesn't work with UITextViews at the moment because it works with any UIControl <UITextInput>, which UITextView is not. In fact, UITextView is a subclass of UIScrollView <UITextInput>.

Problem: the suggestion bar normally observes the UIControlEventEditingChanged event, which is only officially emitted by UIControl subclasses. Yet we want TOMSSuggestionBar to support all sorts of controls, like

  • UISearchBar
  • UITextView
  • UITextField

Looking at the class hierarchy their common superclass is UIResponder — this is too high up for UIControl behaviours.

Possible Solution: use https://github.com/andrewsardone/UITextView-UIControl

@tomknig
Copy link
Owner

tomknig commented Jul 25, 2014

I agree, that would be nice!
What do you mean by solution? Do you mean like UITextView+UIControl should be added as dependency to the project?

@fatuhoku
Copy link
Contributor Author

Hmm...

Yes — UITextView+UIControl it works brilliantly — from TOMSuggestionBar's perspective we may need to handle UITextView as a special case, and check for the availability addTarget:action: with respondsToSelector: or something horrible like that.

There's no level of abstraction where UITextView fits in neatly, basically. :(

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

No branches or pull requests

2 participants