Class UITextView

A UILabel is a UIView specialized for displaying a single line of text. A UITextView is a UIView specialized for displaying multiple lines of text. It knows about the newline character \n.

The text property of a UITextView is an NSString, not an NSMutableString. To change it, we must assign a new NSString object to it. We can also pop up a keyboard and let the user type new text. All the text has to be in the same font. Use a UIWebView if you want different fonts.

Source code in TextView.zip

  1. main.m
  2. Class TextViewAppDelegate
  3. Class View

Special characters

Edit → Special Characters… → Punctuation

Star-cross’d has an apostophe, not a single quote: star-cross'd. See the single quote in “misadventur'd”.
1–14 has an en-dash, not a dash: 1-14.