For those who are familiar with Objective-C, you know that there are different classes for mutable and nonmutable collections. For example, to define a mutable array, we use the NSMutableArray
class, and to define a nonmutable array, we use the NSArray
class. Swift is a little different because it does not contain separate classes for mutable and nonmutable collections. Instead, we define whether a collection is constant (nonmutable) or a variable (mutable) by using the let
and var
keywords. This should seem familiar since, in Swift, we define constants with the let
keyword and variables with the var
keyword.
Mastering Swift
By :
Mastering Swift
By:
Overview of this book
Table of Contents (22 chapters)
Mastering Swift
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Taking the First Steps with Swift
Learning about Variables, Constants, Strings, and Operators
Using Collections and Cocoa Data Types
Control Flow and Functions
Classes and Structures
Working with XML and JSON Data
Custom Subscripting
Using Optional Type and Optional Chaining
Working with Generics
Working with Closures
Using Mix and Match
Concurrency and Parallelism in Swift
Swift Formatting and Style Guide
Network Development with Swift
Adopting Design Patterns in Swift
Index
Customer Reviews