UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Understanding Swift

Join over 90,000 readers today

Learn the why of Swift

Includes free updates for new Swift versions – click to read my update policy

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.

Download full table of contents

Download free sample

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.