Working with Strings and Collections
Chapter 2 introduced the basic structure of Swift and explained the different types, mutability versus immutability, and notable syntax changes, among other things. This chapter builds on that foundation of knowledge, focusing on creating and manipulating strings and collections of values.
Working with Strings
The Swift String value type is bridged seamlessly to Objective-C’s NSString class, meaning that any NSString method can be called on a String value, and a String value can be used with any API that expects an NSString instance. However, this does not mean that there is complete interchangability between String and NSString. For example, String methods such as toInt()(), computed properties ...