Chapter 8. Strings

Strings are a core component of any programming language. Until the day we can program, and interact, with our computers completely through verbal and audio cues, text will continue to be our primary method of interfacing with these machines. Most other programming languages have sufficiently advanced native string support, yet surprisingly Objective-C relies on Apple’s Foundation library to provide anything more advanced than the low-level string functions provided by C.

Swift’s powerful native string type (conveniently named String) is designed to coexist with NSString. Given the extent to which NSString is embedded in the AppKit and UIKit frameworks, being able to use String wherever an NSString is expected (and vice versa) ...

Get Swift Translation Guide for Objective-C Users: Develop and Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.