title: Why Apple’s SimpleTextInput sample code is inefficient
body: <p>I’m looking at Apple’s <a href="http://developer.apple.com/library/ios/#samplecode/SimpleTextInput/Introduction/Intro.html" rel="nofollow">SimpleTextInput sample code</a>, which is a sample project for an iOS text editor that uses Core Text to display the text. This is a wonderful thing.</p>
  
  <p>But its ReadMe document says:</p>
  
  <blockquote>
    <p>This sample code should not be considered a template for a text editor, but rather as an example of how to bind the text input system to a pre-existing text editor. The project's use of CoreText is naive and inefficient;  it deals only with left-to-right text layout, and it is by no means a good template for any text editor.  It is a implementation meant only to illustrate how to bind the system keyboard (that is, the text input system) to some pre-existing text editor.</p>
  </blockquote>
  
  <p>I’m curious as to <em>how</em> this text editor is inefficient. Is it something fundamental in its design? Is it something that simple tweaks could improve? <code>UITextView</code> might have really elaborate caching algorithms hidden in it; so, would the problem be that SimpleTextInput lacks them?</p>