Thursday, March 28, 2013

TextEdit 1.8 Source Code

Apple has posted the source for TextEdit, which used to be available as part of the Xcode installer (via Zach Drayer). I miss the days when you could do a local search of all the sample code and documentation. Now, everything is scattered online, where it’s harder to search and subject to removal.

3 Comments RSS · Twitter

Even though the source code is totally pointless from a UI perspective considering the UI of TextEdit is not either modern or HIG compliant (e.g. the Preferences window), the source code can prove useful to discover features of TextEdit:

A quick look at the Select line controller code made me discover that you can write 12-14 in the text field of the "Select Line" window to select these 3 lines.

There are other possible values such as +12-14 to select the 12, 13 and 14th lines after the current insertion point or -2 to select the line 2 lines before the current insertion point.

@stephane Agreed. If Apple’s going to put the sample code online, I wish they’d put it on GitHub or something. Then it would be easy to search, update, see the changes between versions, etc.

@Michael: Indeed, there _are_ good ways of making content available online. It's just that Apple are utterly dedicated to finding the worst possible ways of doing it instead. See also: the entire OSX/iOS developer documentation site, which has been utterly hideous to use ever since it got infested by AJAX-huffing Web2.0 cretins.

(Though to be fair, Apple are are far from the only ones inventing ever more fantastically ingenious ways to totally and utterly fuck up the web. IMO, the net would be immeasurably improved if 99.9% of web developers were to have their fingers slammed with a piano lid tomorrow. Really, really hard; and repeatedly.)

Leave a Comment