3

I am looking for a way to show my own input view (a UITableView) to enter certain keywords in a UITextView faster than typing them, and also be able to type into this text view the normal way. My solution has a button that causes the keyboard to disappear, revealing the table view underneath it.

Problem is I can't figure out how to make the keyboard go away without resigning first responder, and losing the cursor. Has anyone accomplished this before?

Thanks for any help.

Alex Gosselin
  • 2,942
  • 21
  • 37

2 Answers2

2

Nope

As far as I know there is no way to do this, and I have searched extensively. Very frustrating that selection and the cursor are restricted to the keyboard.

I could be wrong though. Votes? Suggestions?

Alex Gosselin
  • 2,942
  • 21
  • 37
2

You can call becomeFirstResponder on some other thing that you choose. It could be a UIViewController or a UIView. I had a similar problem before, I needed to make my keyboard go away when I was pushing my view controller back to its caller, without knowing which textfield was the first responder. Then, on viewWillAppear of my view controller which I was returning back, I called [self becomeFirstResponder] and the keyboard of the pushed view was gone. Because this made whichever text field was it loose being the first responder.

aslı
  • 8,740
  • 10
  • 59
  • 80
  • That does make the keyboard go away without resigning first responder, but it doesn't allow me to keep the cursor in the text view so I can add things in using my own input view. – Alex Gosselin Jul 13 '11 at 21:51