Summary
Text plays a central role in desktop computing, and it is likely you will frequently need all the skills you gained in this chapter. It's likely you'll also need several more, and hopefully, your understanding of the material here will stand you in good stead when it comes to discovering and absorbing more of the huge flexibility afforded to us by Swift strings and the Cocoa string and text classes.
You have learned the following in this chapter:
- The structure and representations of strings and characters
- Using indices and subranges when accessing and mutating strings
- Fonts and string formatting
- Understanding the internal structure of
NSTextView
, and the roles ofNSTextStorage
,NSTextContainer
, andNSLayoutManager
- Creating custom text storage for a text view
The next chapter, we'll go beyond drawing text, as we look at one of the most powerful frameworks available on macOS: Core Graphics.