views:

697

answers:

1

I have the following problem: I got a view with two text fields and a UITextView (non editable, but scrolling) to show some infos. When the keyboard is shown I slide the whole view up so both text fields and the keyboard are shown. When the user clicks outside of the text fields I hide the keyboard and move the view back down.

This works only if the user does not click on the UITextView to hide the keyboard. If I turn of "User Interaction Enabled" in IB it works but UITextView won't be scrollable.

How do I set the "User Interaction Enabled" in code so whenever the keyboard is shown I would disable it? Or is there a better way to solve this?

tia Stefan

+3  A: 

Set the userInteractionEnabled property:

//UITextView *textView;
textView.userInteractionEnabled = YES;
Daniel Dickison
Oh no, I did search the documentation for this but could not find it. I was blind! It's right there in UIView. Thank you Daniel.
sliver
No problem. It's easy to miss inherited methods and properties in Apple's documentation because they are not listed directly -- you have to navigate up to the superclass reference page to see them.
Daniel Dickison