The Swift Programming Language (5.10)
Welcome to Swift
Understand the high-level goals of the language.
Learn what functionality is available in older language modes.
Explore the features and syntax of Swift.
Language Guide
Work with common kinds of data and write basic syntax.
Perform operations like assignment, arithmetic, and comparison.
Store and manipulate text.
Organize data using arrays, sets, and dictionaries.
Structure code with branches, loops, and early exits.
Define and call functions, label their arguments, and use their return values.
Group code that executes together, without creating a named function.
Model custom types that define a list of possible values.
Model custom types that encapsulate data.
Access stored and computed values that are part of an instance or type.
Define and call functions that are part of an instance or type.
Access the elements of a collection.
Subclass to add or override functionality.
Set the initial values for a type’s stored properties and perform one-time setup.
Release resources that require custom cleanup.
Access members of an optional value without unwrapping.
Respond to and recover from errors.
Perform asynchronous operations.
Use macros to generate code at compile time.
Determine a value’s runtime type and give it more specific type information.
Define types inside the scope of another type.
Add functionality to an existing type.
Define requirements that conforming types must implement.
Write code that works for multiple types and specify requirements for those types.
Hide implementation details about a value’s type.
Model the lifetime of objects and their relationships.
Structure your code to avoid conflicts when accessing memory.
Manage the visibility of code by declaration, file, and module.
Define custom operators, perform bitwise operations, and use builder syntax.
Language Reference
Read the notation that the formal grammar uses.
Use the lowest-level components of the syntax.
Use built-in named and compound types.
Access, modify, and assign values.
Group expressions and control the flow of execution.
Introduce types, operators, variables, and other names and constructs.
Add information to declarations and types.
Match and destructure values.
Generic Parameters and Arguments
Generalize declarations to abstract away concrete types.
Read the whole formal grammar.
Revision History
Review the recent changes to this book.