Your next career begins with
Save 50% off your seat in our next iOS Bootcamp. Limited time only. Sessions start April 3.
Swift Apprentice: Fundamentals
Beginning programming with Swift! This book covers the fundamentals of Swift: Apple’s modern programming language for iOS, iPadOS, macOS, watchOS and beyond. By Ehab Amer, Matt Galloway, Alexis Gallagher & Eli Ganim.
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress, bookmark, personalise your learner profile and more!
Create accountAlready a member of Kodeco? Sign in
Who is this for?
This is a book for complete beginners to Apple’s modern programming language — Swift.
Covered concepts
All the code in the book works inside of Xcode’s easy-to-use playgrounds. That means you can focus on core Swift language concepts, such as classes, protocols, and generics, instead of getting bogged down in the details of building apps.
This is a companion book to the SwiftUI Apprentice; the SwiftUI Apprentice focuses on building apps, while Swift Apprentice focuses on the Swift language itself.
This is a book for complete beginners to Apple’s modern programming language — Swift.
All the code in the book works inside of Xcode’s easy-to-use playgrounds. That means you can focus on core Swift language concepts, such as classes, protocols, and generics without getting bogged down by extraneous details.
This...
moreThis is a book for complete beginners to Apple’s modern programming language — Swift.
All the code in the book works inside of Xcode’s easy-to-use playgrounds. That means you can focus on core Swift language concepts, such as classes, protocols, and generics without getting bogged down by extraneous details.
This is a companion book to the SwiftUI Apprentice; the SwiftUI Apprentice focuses on building apps, while Swift Apprentice focuses on the Swift language itself.
Before You Begin
This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book and more.
Section I: Swift Basics
The chapters in this section will introduce you to the very basics of programming in Swift. From the fundamentals of how computers work up to language structures, you’ll cover enough of the language to be able to work with data and organize your code’s behavior.
The section begins with some groundwork to get you started. Once you have the basic data types in your head, it’ll be time to do things with that data, and finally, you’ll learn about an essential data type, optionals, that let you express potentially missing data.
These fundamentals will get you Swiftly on your way, and before you know it, you’ll be ready for the more advanced topics that follow. Let’s get started!
Section II: Collection Types
So far, you’ve mostly seen data in the form of single elements. Although tuples can have multiple pieces of data, you have to specify the size upfront; a tuple with three strings is a completely different type from a tuple with two strings, and converting between them isn’t trivial. In this section, you’ll learn about collection types in Swift. Collections are flexible “containers” that let you store any number of values together.
There are several collection types in Swift, but three important ones are arrays, dictionaries and sets. You’ll learn to apply custom operations and loop over collection types. Finally, you’ll revisit strings, which are collections of characters.
All the collection types share similar interfaces but have very different use cases. As you read through these chapters, keep the differences in mind, and you’ll begin to develop a feel for which type you should use when.
Section III: Building Your Own Types
You can create your own type by combining variables and functions into a new type definition. When you create a new type, you give it a name; thus, these custom types are known as named types. Structures are a powerful tool for modeling real-world concepts. You can encapsulate related concepts, properties and methods into a single, cohesive model.
Swift includes four kinds of named types: structures, classes, enumerations and protocols. You’ll learn here how other named types use the concepts of methods and properties, how they differ, and where you want to use each.
You’ll also learn about protocols & generics, which are types and methods that take as input other types instead of just methods, as well as custom types to build larger and complex things!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development — plans start at just $19.99/month! Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.
Learn more