Announcing Swift Apprentice, Seventh Edition!

Go from novice to expert in Swift with hands-on activities in Xcode playgrounds with our newly-updated book. By B. Patil.

Save for later

Are you a Swift beginner wondering how to become a Swift expert?

Do you ever wonder, “What’s the best resource to get me from where I am now to where I want to be in my Swift journey?”

Well, the wait for that resource is over, and the time has come for you to go from being a Swift beginner to blossoming into a Swift expert.

Knock, Knock. Swift Apprentice Is At The Door.

Our Swift Apprentice book is here to teach you all about core Swift language concepts, such as classes, protocols, generics and more!

This book is a companion book to the UIKit Apprentice. UIKit Apprentice focuses on building apps, while Swift Apprentice focuses on the Swift language itself. So you’ll become a Swift language pro, without getting bogged down in the details of building iOS apps.

Who Is This Book For?

If you’re a complete beginner to Swift and wish to dive deep into the language, this book is for you.

What’s Inside the Book?

The newly-updated edition of Swift Apprentice kicks off with the basics of Swift.

Section I: Swift Basics

The chapters in this section will introduce you to the very basics of programming in Swift. You’ll learn about:

  • Expressions, Variables & Constants
  • Types & Operations
  • Basic Control Flow
  • Advanced Control Flow
  • Functions
  • Optionals

Here’s a sneak peek at Playgrounds in Xcode, something which you’ll use to practice your Swift skills in this section, and the rest of the book:

Section II: Collection Types

In this section, you’ll learn about collection types in Swift. Collections are flexible “containers” that let you store any number of values together.

You’ll learn about the following types of collections:

  • Arrays, Dictionaries & Sets
  • Collection Iteration With Closures
  • Strings

Here’s a sneak peek at how Arrays are structured:

Section III: Building Your Own Types

With Swift, 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.

Here’s what you’ll learn in this section:

  • Structures
  • Properties
  • Methods
  • Classes
  • Enumerations
  • Protocols
  • Generics

Here’s a sneak peek at how to write a class in Swift:

Section IV: Advanced Topics

In this final section of the book, you’ll learn about:

  • Access Control, Code Organization & Testing
  • Custom Operators, Subscripts & Keypaths
  • Result Builders
  • Pattern Matching
  • Memory Management
  • Error Handling

And more! Here’s a sneak peek at NSAttributedString, which is a special object that holds a string and lets you add attributes, like color and font, to the whole string or only to part of it:

What Do You Need?

To follow along with this book, you’ll need the following:

  • A Mac running macOS Big Sur 11.6 or later, with the latest point release and security patches installed. This is so you can install the latest version of the required development tool: Xcode.
  • Xcode 13 or later. Xcode is the main development tool for writing code in Swift. You need Xcode 13 at a minimum, since that version includes Swift 5.5 Xcode playgrounds. You can download the latest version of Xcode for free from the Mac App Store, here:

How to Get Your Own Copy

There are two ways you can get this book:

  • Buy it individually: If you want to build up a custom library without a subscription, you can choose to buy the book individually. It’s available now for just $59.99 in our online store.
  • Get it as part of our Beginner & Pro subscriptions: Enjoy access to our videos and mobile development books in our Ultimate Beginner and Ultimate Pro subscriptions, including Swift Apprentice! Right now, you can get a full year’s subscription and save 20% off the cost of a regular monthly subscription. It’s simply the best investment for your development career.

We hope you enjoy this book! Feel free to reach out to us if you have any questions.

Say Hi to our Team! 👋

Meet the awesome folks who contributed to this book…

Ehab Amer [Author]: Ehab Amer is an author of this book. He is a very enthusiastic Lead iOS developer with a very diverse experience, from building games to enterprise applications and POCs, especially when exploring new technologies. In his spare time, TV shows take the majority, followed by video games. When away from the screen, he goes with his friends for escape room experiences or to explore the underwater world through diving.

Alexis Gallagher [Author]: Alexis Gallagher is an author of this book. He’s worked in consulting, science, iOS development, startup management, and theater. Perhaps the only software engineer in San Francisco who was born there, he lives there now with his family, and works at Google on machine learning research and applications.

Matt Galloway [Author]: Matt Galloway is an author of this book. He is a software engineer with a passion for excellence. He stumbled into iOS programming when it first was a thing, and he has never looked back. When not coding, he likes to brew his own beer.

Eli Ganim [Author]: Eli Ganim is an author of this book. He is a Software Engineer who’s passionate about teaching, writing and sharing knowledge with others. He lives in Israel with his wife and kids.

Ben Morrow [Author]: Ben Morrow is an author of this book. He delights in discovering the unspoken nature of the world. He’ll tell you the surprising bits while on a walk. He produces beauty by drawing out the raw wisdom that exists within each of us.

Cosmin Pupăză [Author]: Cosmin Pupăză is an author of this book. He is a tutorial writer from Romania. He has worked with more than a dozen programming languages over the years, but none has made such a great impact on himself as Swift. When not coding, he either plays the guitar or studies WWII history.

Sandra Grauschopf [Editor]: Sandra Grauschopf is an editor of this book. Sandra is a freelance writer, editor, and content strategist as well as the Editing Team Lead at She loves to untangle tortured sentences and to travel the world with a trusty book in her hand. You can follow her on Twitter at @SGrauschopf or learn more about her at

Steven Van Impe [Tech Editor]: Steven Van Impe is the technical editor of this book. Steven is a computer science author and lecturer at the HOGENT University of Applied Sciences in Belgium. You can find Steven on Twitter as @pwsacademy.

Ray Fix [Final Pass Editor]: Ray Fix is the final pass editor of this book. During the day, Ray works on next-generation microscopes made for iPad at Discover Echo Inc. in San Diego, California. He enjoys learning new things and is excited about math, data, visualization, machine learning and computer vision. Swift is his problem-solving language of choice and he has been using it and teaching others about it since its 2014 public release. Twitter: @rayfix.

B. Patil


B. Patil


Over 300 content creators. Join our team.