O'Reilly logo

Transitioning to Swift by Scott Gardner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    3

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required