Wednesday, February 1, 2012

A Plea for Better iOS Text Facilities

Buzz Andersen:

What we really need is a facility that provides access to at least some subset of WebKit HTML rendering capabilities at a level between CoreText and UIWebView—something that doesn’t require developers to essentially re-invent HTML and CSS but allows them to render at least some level of HTML formatted text to a native view or layer without the overhead and inflexibility of UIWebView—basically, a next generation version of Mac OS X Cocoa’s NSAttributedString. I’m sure providing such a facility in the limited environment of the iOS presents significant engineering challenges, but Android has such an API, and I think the absence of such an API on iOS is holding the platform back as a media platform more than almost anything else I can think of.

Gus Mueller:

I used to think that rich text editing of some sort on iOS was just around the corner. I’ve even had folks at Apple tell me ”just wait,” as if it was almost here. That was years ago. At this point, I almost think it’s on purpose that we don’t have any sort of rich text editing. I just can’t figure out why.

It’s strange since NSTextView has been such a massive success on Mac OS X.

2 Comments RSS · Twitter

Dear motherfucking sweet Lord did I wish for such a thing when I added support for italics in subtitles for CineXplayer ("What do you mean a UILabel can only be in italics as a whole or not at all? Argh!"). In particular, I have a bunch of CoreText code to make sure I can have the same ellipse cutting behavior as UILabel (subtitle display is not exactly the place to put a scrollbar when there is too much text to fit…), as the behavior I wanted was not directly supported by CoreText. And don't even mention the radars I hit on the way…

The worst thing is, it's clear from the profiler that UILabel actually uses (private) WebKit functions to render the text, so the text rendering features of WebKit are already available outside of a "pure" web context, so even if Apple doesn't want to give access to these functions, it would be easy for them to provide a control or an infrastructure that would support more features than UILabel and which would be easier to control than UIWebView. Sigh…

"It’s strange since NSTextView has been such a massive success on Mac OS X."

My modest proposal would be for them to drop NSTextView in 10.8 in their continuing efforts to make OS X more iOS-like...

Leave a Comment