Sebastien Peek
Sebastien Peek

Reputation: 2528

UITextView editing is disabled until "touched"

Currently working on a brand new application and I'm wanting the same functionality as Notes.app when it comes to the UITextView.

It is apparent that they have editing on the UITextView disabled until the user touches it, or else events, links, phone numbers etc wouldn't be selectable. What I'm curious to know is how this is achievable by oneself?

Any help would be appreciated.

EDIT: Any code would be appreciated too, I need somewhere to start.

Upvotes: 1

Views: 312

Answers (1)

clstroud
clstroud

Reputation: 143

If you subclass UITableView, override touchesBegan and make a BOOL or some other sort of check that would prevent it from calling [super touchesBegan];.

The other alternative solution would be to subclass a UIView and place it over the table, make it transparent and then make it disappear after it gets touched.

Both of these are not optimal solutions, however it sounds like this is a pretty small task, it should do the job.

Upvotes: 2

Related Questions