Programming in Swift
Learn about Apple’s open source programming language, Swift, through hands-on examples! This series is up-to-date for Swift 4 and uses Xcode 9. By Ray Wenderlich.
Part 1: Part 1: Core Concepts
Let's review what you'll be learning in this section, and why it's important.
Learn how to create your first Swift playground, and see how useful it can be to learn Swift, and use in day-to-day development.
Learn the various ways to add comments to your Swift code - a useful way to document your work or add notes for future reference.
Learn the group related data together into a single unit, through the power of a Swift type called Tuples.
Practice using tuples on your own, through a hands-on challenge.
Learn how to use a Swift type called Booleans, which represent true or false values.
Practice using booleans on your own, through a hands-on challenge.
Learn what the concept of scope means in Swift, and how it applies to if statements.
Let's review where you are with your Swift core concepts, and discuss what's next.
Part 2: Part 2: Flow Control
Let's review what you'll be learning in this section, and why it's important.
Learn how to make Swift repeat your code multiple times with while loops, repeat while loops, and break statements.
Practice using while loops on your own, through a hands-on challenge.
Learn how to use for loops in Swift, along with ranges, continue, and labeled statements.
Practice using for loops on your own, through a hands-on challenge.
Learn how to use switch statements in Swift, including some of its more powerful features.
Practice using switch statements on your own, through a hands-on challenge.
Let's review what you learned in this section, and discuss what's next.
Part 3: Part 3: Functions and Optionals
Let's review what you'll be learning in this section, and why it's important.
Learn how to write your own functions in Swift, and see for yourself how Swift makes them easy to use.
Practice writing functions on your own, through a hands-on challenge.
Learn some more advanced features of functions, such as overloading, inout parameters, and functions as variables.
Learn about one of the most important aspects of Swift development - optionals - through a fun analogy.
Practice using optionals on your own, through a hands-on challenge.
Learn how to unwrap optionals, force unwrap optionals, use optional binding, and use the guard statement.
Practice working with optionals on your own, through a hands-on challenge.
Let's review where you are with your Swift core concepts, and discuss what's next.
Part 4: Part 4: Collections
Let's review what you'll be learning in this section, and why it's important.
Learn how to use arrays in Swift to store an ordered list of values.
Practice using arrays on your own, through a hands-on challenge.
Learn how to use dictionaries in Swift to store an unordered collection of pairs.
Practice using dictionaries on your own, through a hands-on challenge.
Learn how to use Sets in Swift to store an unordered collection of unique values.
Learn how to create closures in Swift - which you can think of as a method without a name.
Learn how you can use closures to sort collections, filter collections, run calculations on elements within a collection, and more.
Practice using closures on your own, through a hands-on challenge.
Learn which collection you should use in a given situation.
Learn how a string works in Swift, along with some useful things you can do with strings - and why strings are collections too.
Let's review what you learned in this section, and discuss what's next.
Part 5: Part 5: Structures
Let's review what you'll be learning in this section, and why it's important.
Learn how to group data and functionality together in Swift, using a value type called structures.
Practice using structures on your own, through a hands-on challenge.
Learn how to make your types conform to protocols in Swift, which you can think of as a to-do list for your types.
Learn how to add two types of properties to your types: stored properties, and computed properties.
Practice creating properties on your own, through a hands-on challenge.
Learn when it's best to use computed properties, and when it's best to use methods.
Take a deep dive into methods, including writing initializers, mutating methods, extensions, and more.
Practice writing methods on your own, through a hands-on challenge.
Let's review what you learned in this section, and discuss what's next.
Part 6: Part 6: Classes
Let's review what you'll be learning in this section, and why it's important.
Learn about the differences between classes and structures in Swift, and when you should use which.
Practice working with classes and understanding when to use them vs. structures, through a hands-on challenge.
Learn how you can inherit functionality from another class in Swift.
Learn how to create your own class initializers, including two-phase initializatoin, and required vs. convenience initializers.
Practice creating your own class initializers, through a hands-on challenge.
Learn when you should subclass, and when you shouldn't.
Learn how Swift manages memory under the hood, how you can tell when an object is deinitialized, and how you can avoid a nasty memory leak in your apps.
Let's review where you're at with your Swift core concepts, and discuss what's next.