Lots of tutorials show you how something is done with Swift, but this book aims to teach you why things are the way they are, and why each component of Swift can help you write better software.
BEGINNER FRIENDLY: Rather than make assumptions about what you know, this book starts by explaining why various types are useful, then works through to closures, optionals, and beyond.
WIDE COVERAGE: Whether you have a question about protocol extensions, enum associated values, static properties, or more, this book will help get them answered quickly.
CLEAR EXPLANATIONS: Every answer in this book has been kept as short and to the point as possible, making it easy to get answers to your questions in just a few minutes.
INCLUDES CODE: Whenever it will help you understand something more clearly, you'll find hands-on code samples that you can paste into Xcode and try for yourself.
What's in the book?
Understanding Swift was written to get to the root of the fundamental questions folks have when learning Swift: why things are the way they are, when one language feature should be used rather than another, and more.
While reading, you'll learn all this and more:
- Why does Swift have constants as well as variables?
- How are tuples different from arrays in Swift?
- Why would you want to associate a value with an enum case?
- Why can’t Swift add a Double to an Int?
- When should you use the ternary operator in Swift?
- How can you return two or more values from a function?
- Why are Swift’s closure parameters inside the braces?
- What’s the difference between a struct and a tuple?
- Why does Swift have both classes and structs?
- Why does Swift make us unwrap optionals?
- Why would you want a failable initializer?
This book is simply packed with clear, concise answers to help maximize your understanding of Swift.
Prefer to read for free?
This is the download edition of Understanding Swift that gives you the PDF and ePub for offline reading, but if you'd rather read for free online you can find the book online here: free Swift tutorials.
The Hacking with Swift guarantee
We want everyone to be happy with all the Hacking with Swift courses they buy, both now and in the future, which is why all our books come with free lifetime Swift updates and free bonus content with our Frequent Flyer Club, and we also encourage folks to join our Slack community to help solve problems.
However, if you aren't happy with a course you bought from us, we offer a 30-day No Questions Asked refund policy. This applies to all books and video courses purchased through Gumroad, which is our primary distributor. So, if you aren't happy with your purchase, if you changed your mind, or if you just bought the wrong thing by accident, we can refund your purchase up to 30 days after it was made.
Any other questions?
You can email me at firstname.lastname@example.org or tweet me @twostraws, and I'll do my best to help.
You've purchased this product
See it in your libraryView in Library
We charged your card and sent you a receipt
You'll need an account to access this in our app. Please create a password to continue.
Download from the App Store or text yourself a link to the app
Good news! Since you already have a Gumroad account, it's also been added to your library.