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 Are you tired of wasting time debugging your Swift app? Instabug’s SDK is here to help you minimize debugging time by providing you with complete device details, network logs, and reproduction steps with every bug report. All data is attached automatically, and it only takes a line of code to setup. Start your free trial now and get 3 months off exclusively for the Hacking with Swift Community.
Link copied to your pasteboard.