Updated for Xcode 13.2
This guide is called Understanding Swift, because it focuses on trying to explain why Swift is the way it is – why we have arrays as well as sets, why enums can have associated values, when forcing unwrapping makes sense, and more.
I have literally tried to structure this so that many entries starts with “Why does Swift…” or “When would you…” because this is about answering your questions as effectively as I can.
You’ll see that some chapters have “should” in the title, such as “When should you write throwing functions?” – these are places where I’ve tried to provide some guidance to help you understand scenarios when certain features are useful. My goal here isn’t to tell you how to write your Swift code, but instead to give you some broad guidance that helps you come to your own conclusions. I highly recommend you try things out for yourself, read opinions from myself and others, and decide what works best for your code.
If you’ve already had some experience with Swift, I recommend you just jump to whichever chapter interests you and read from there. There’s no need to read in a special order; just dive in and enjoy.
If you’re just starting with Swift, the best way to read this book is by treating it as a supplement to either my 100 Days of SwiftUI or my 100 Days of Swift. Those courses both start by teaching you the fundamentals of Swift development in a practical way, and will link you back to here so you can get some more explanation as and when you need it.
SPONSORED Learn the most up-to-date techniques and strategies for testing new and legacy Swift code in this free practical course for iOS devs who want to become complete Senior iOS Developers.
Link copied to your pasteboard.