views:

283

answers:

1

Hello all,

I'm looking to customise the behaviour of a UITextView quite dramatically - adding in regex-based highlighting, line numbers and find and replace - as I essentially want to create a text editor on the iPhone/iPad.

I've been looking through the UITextView reference but it seems to be very restricted, not very customisable at all. I don't really know the underlying frameworks very well, so any help would be appreciated. My lack of in-depth knowledge notwithstanding, I want to do something pretty advanced, so any help at all would be really really appreciated.

My best,

Jamie

+1  A: 

Unfortunately what you're seeing with UITextView is exactly what you get. It's not designed to support the kind of features you describe.

In the latest iPhone OS your best bet would be to deploy a Javascript-based editor in a UIWebView. Do the text handling in JS. Yeah, that's probably no fun, but unlike UITextView it's actually possible.

Alternately code your own text view from the ground up. Again, no fun, but has the benefit of being possible.

If you have access to pre-releases of future iPhone OSs, watch for new improvements and features. Apple's demo of Pages for iPad clearly uses something more sophisticated than the current UITextView, and the iWork apps supposedly use only public APIs. That would imply something closer to what you need will be available in a future release.

Tom Harrington
Agreed. Wait for iPhone OS 3.2.
Brad Larson
That should be *WAIT for new improvements and features* - so far nothing exciting has been released imo.
St3fan
He did tag this as iPad, and if you read the iPhone OS 3.2 release notes, I think you'll see a number of things that will make his job a lot easier. The NDA makes this difficult to discuss further.
Brad Larson