
Learn how to access course benefits, join the Slack community, and use token authentication to view the e-book and lessons from chapters 1 to 10, with prerequisites for intermediate Swift.
Discover what makes Swift different from other languages, including its question mark and exclamation syntax. Learn generics, error handling, and guard to create a modern, safe, reusable code base.
Learn why swift introduces optionals to prevent nil value crashes by enforcing types and values. Discover how to unwrap optionals safely, using implicit binding instead of force unwrapping.
Explore optional chaining in Swift, using question marks and exclamation marks to access properties and methods. Understand optional types, initialization, and unwrapping, including forced and safe nil handling.
Explore guard and defer statements in Swift, learn alternatives to else-if, and safely unwrap multiple optionals in a single line to write cleaner, more readable code.
Learn Swift error handling by separating concerns, using throw and do-catch, and choosing between try, try?, and try! to manage optionals and errors safely.
Explore type casting in Swift, learning upcasting and downcasting with as, as?, and as!, including safe optional downcasts, and applying to UI components and common base types.
Learn how generics in Swift enable reusable functions and types that work with any type. Reduce duplication and boost scalability with type placeholders like T.
discover how subscripts enable concise access to array and dictionary values using brackets, returning values with optional handling and defaults, and why context matters for readable code.
Learn the fundamental differences between classes and structs in Swift, comparing reference vs value types, memory addresses, mutability, and when to prefer structs over classes for safer, lighter code.
Explore sets, arrays, and tuples in Swift 4, learn to eliminate duplicates, perform set operations like union and intersection, and convert between arrays and sets with mutating vs non-mutating methods.
Learn how Swift extensions add properties and methods outside a type boundary to keep code modular, including computed properties and initializers, and extending primitives like int.
Explore Swift operators, including the ternary operator and optional unwrapping. Learn how to replace if-else with concise expressions and default values for nil.
Learn how to use typealias in Swift to create readable aliases for strings, tuples, and custom types like an employee, and explore array, dictionary, and optional initializations.
Master optional handling with guard statements and early exits, and manage multiple optionals in Swift. Understand classes vs structs, reference vs value types, and apply generics, extensions, and do-try-catch.
Explore object-oriented programming concepts in iOS development, and learn to write modular code with singleton patterns, type properties, and convenience features.
Learn how convenience initializers enable lazy, readable object initialization in Swift, using extensions to simplify color creation and streamline object setup for open source projects.
Learn how computed properties create a relationship between values, using gettable and settable forms to derive diameter from radius and area from side.
Explore Swift property observers by adding willSet and didSet to a stored property, track old value and new value, and differentiate from computed properties through practical login and UI examples.
Learn how to implement a failable initializer in Swift that returns nil for an empty name, and compare it to the error handling approach with try and catch.
Explore inheritance in Swift by learning how to override methods and properties, use super to access superclass behavior, and implement custom initializers in classes.
Learn two-phase initialization in Swift, using self.init to initialize related properties with unit conversions (meters, feet, gallons) and distinguish it from convenience initializers via practical examples.
Explore type properties and methods in Swift by comparing static and class members, including stored and computed properties, and using final to prevent overrides.
Learn to implement a singleton pattern by creating a single shared account manager that initializes once and is accessible across the app, enabling centralized data, networking, and communication between controllers.
Learn to wire methods and properties, initialize one method from another, use convenience methods, add property observers, and build variable relationships as you transition toward functional programming.
Explore closures in Swift: understand escaping closures, how to initialize objects with closures, capture self, and design a closure-based solution for your own project, with practical guidance.
Explore closures in Swift, learning how a function without a name differs from normal functions. Define and type closures, call them, and use concise syntax with parameters and dollar-sign shorthand.
Master Swift closures by returning and passing closure blocks, both directly and indirectly. Learn closure syntax, including first-parameter brackets and the dollar sign for arguments.
Learn how to initialize objects with closures in Swift and why lazy initialization defers heavy work until needed, enabling dry, reusable UI components.
Explore how closures in Swift behave as reference types, how capture lists fix late binding and aid memory management by capturing values at creation.
Learn how trailing closures shorten long closure parameters in Swift, and apply them at the end of function calls with examples that boost readability.
Master completion handlers in Swift by using closures to run code after a task, such as a view controller transition or download. Learn trailing closures, parameter passing, and user notifications when tasks finish.
Master closures in Swift by passing and returning closure blocks to and from functions, create objects using closure blocks, and understand the lazy keyword and the unique behavior of closures.
Master Swift 4 syntax, explore typecasting flaws, and learn to communicate between objects using delegates and data sources in this intermediate to advanced chapter.
Learn why Swift protocols replace heavy object-oriented inheritance and how to conform with properties and methods, including get and set distinctions for stored and computed properties.
Learn protocol extension to provide default implementations and write less code. See practical examples like GPA defaults and area calculations for rectangles and hexagons, with UIKit animation.
Explore using protocols as types to group diverse objects in Swift without typecasting. Learn how generics and protocols enable flexible, type-safe code, including a speakable protocol with a price property.
Explore how the delegate pattern enables data transfer between objects using protocols, where a delegator (first view controller) sends data to a delegate (second view controller) via pass data method.
Explore the data source pattern and bidirectional delegate communication in Swift, showing how a table view uses delegate and data source protocols to drive content.
Conclude with protocol oriented design in Swift, covering protocol extensions, delegation and data source patterns to build scalable code, and introduce generics and a small C type.
Discover memory management concepts and the role of the operating system in managing memory, focusing on reference types, classes, and closures. Build familiarity with closures and the delegate pattern.
Explore automatic reference counting in Swift, learning memory management basics, how memory is allocated and deallocated, and how strong and weak references prevent retain cycles, leaks, and nil-related issues.
Explore how delegate patterns can create a retain cycle in Swift, and learn to break it with weak references and lazy initialization to ensure proper deallocation.
Understand how closures in Swift are reference types that can cause retain cycles and learn to prevent them with weak or unowned captures, including self.
Explore escaping closures, autoclosures, and non-escaping defaults in Swift, and learn memory management, background tasks, and lazy closures.
Learn to manage object lifetimes in swift by mastering automatic reference counting, preventing retain cycles with weak or unowned references, and using escaping and non-escaping closures, delegates, and completion handlers.
Explore executing tasks with the functional paradigm in Swift and why it trends across platforms, with a focus on closures and generics.
Learn functional programming with Bob by exploring the functional paradigm. Use functions to drive results, embracing no state, modularity, and concise code.
Explore how filter works in Swift's functional programming, using closure blocks to filter arrays, create generic custom filters, and apply practical examples like filtering grades and even numbers.
Explore how the map function enables applying a single operation to every array element in Swift, leveraging closures and functional programming with a generic, one-line approach.
Explore how to use reduce and map to fold an array into a single value, starting with a seed and a closure, and extend to generic functions.
Conclude the chapter by exploring functional programming in Swift, focusing on filter and map, and understanding what goes on under the hood of each function, including reactive programming ideas.
Learn how to read scalable code base and identify pitfalls in programming, and explore the essential tools you need for effective practice.
Learn how to use associate types and generic protocols in Swift 4, defining an associate type within a protocol and making code reusable through explicit or inferred type relationships.
Explore protocol extensions and type constraints in Swift, using where clauses and self to restrict generic behavior, and work with associate types for scalable code.
Explore how to override protocol associated types in Swift with generic protocols and structs, including type inference and the two-step process for concrete values.
Explore how generic protocols with associated types constrain using Listable as a type, revealing pitfalls in folder and list cell implementations and how type eraser aims to solve them.
Explore type erasure in Swift with a wrapper that converts concrete types to a common interface. Leverage generics, Listable, and any cell patterns to design reusable collection and list cells.
Bob explains that protocols aren’t the ultimate savior and sometimes aren’t needed, teaching a simple, skippable architecture using extensions and generic protocols with a suicide type, to guide design decisions.
Explore practical Swift fundamentals by learning to write practical functions, methods, and properties for safe, quick API design and error handling. Apply these concepts to storyboard and UI alerts.
Explore the enum basics in Swift, covering basic enumerations, raw values, and associated values, with practical examples using switch, optional unwrapping, and barcode scenarios like UPC and QR codes.
Master static and mutating methods with self to design safe, readable Swift APIs, using an enum type, raw values, and practical storyboard and extension techniques.
Explore nested enums in Swift to model game character types, skills, and items with associated values, using a pick-and-choose approach to design flexible APIs without heavy reliance on classes.
Explore protocol oriented enum design by modeling a game character with a lifespan protocol, alive or dead states, and hearts, using mutating methods and a custom operator in Swift.
Explore recursive enums in Swift by building a simple arithmetic expression language with numbers, addition, and multiplication, and learn how recursion and indirect types drive evaluation.
Explore generic enums with associated values and optionals in Swift, learn how to unwrap nil values, and see how these concepts underpin error handling in intermediate to advanced Swift.
Explore error handling using the result type to create modular, reusable code in Swift, contrast with try-catch, and apply clear success and failure cases for API calls.
Conclude the course by refining types, adding properties and methods, and learning when to use debugging and practical API design while choosing the right tools and idioms.
Explore access control, key paths, and generics in Swift 4, and learn to parse JSON to and from objects, plus combining dictionaries with functional programming.
Master Swift access control to protect code, prevent tampering, and improve compilation efficiency by using private, file private, internal, public, and open to control scope.
Explore Swift key paths and optional chaining to access properties and methods efficiently, store a key path, and choose when to apply them for clearer code.
Learn to encode and decode Swift objects to json with Codable, json encoder, and json decoder. Understand converting between objects and json data and handling server responses and errors.
Master advanced codable techniques by implementing custom encoding and decoding with CodingKeys, containers, and a bespoke encoder or decoder to flexibly map keys and properties.
Explore advanced dictionary concepts in Swift, including optional values, default values, initializing from sequences, grouping by first letters, and functional operations like map, filter, and zip.
Conclude chapter nine by reinforcing Swift fundamentals and using documentation and lecture notes to learn. Embrace functional programming with dictionary and the functional paradigm to improve clarity.
Attention
*Please note the course is no longer maintained since 2017.
Why I Created Learn Swift with Bob
As a developer whose first programming language is Swift, I've taken online courses from major platforms. However, I have been frustrated by a lack of detailed explanation from instructors. They tend to focus on final products, thus missing out the fundamentals. I was confused by which design principles to follow, and why. Soon after I've been blogging for the last 5 months, I've discovered this isn't the only problem of mine. I've received hundreds of emails and questions regarding how to write code that does not violate principles such as DRY, modularity, and readability. As a result, I've decided to create this course dedicated for my younger self. I believe it all comes down to the fundamentals which I lacked in the beginning.
Course Overview
There are 10 chapters in this course. From Chapter 1 to 4, you will get a firm understanding of both Intro to Functional, and protocol, and Object Oriented Programming. In Chapter 5, you will fully understand how objects are created and removed. In Chapter 6 and 7, you will learn how to create value oriented swift code along with protocol generics and enums. In the last chapter, you will acquire various advanced and hidden tips about the Swift Programming Language.
Prerequisites
This course is designed for Swift intermediates. So, I won't cover the basics. You may visit the lecture notes and go to prerequisites. You will find a list of items you are expected to know. There is a YouTube video for each concept, so if you ever get stuck, you can always learn and come back. In a nutshell, you should be already be familiar with switch statement, conditional statement, basic operators, functions, and basic object oriented programming.
Questions
Do you know why Swift engineers have implemented optionals? Do you know what completion handlers and how to design one for your project? Do you know retain cycle within closures and delegates? Do you know the difference between autoclosures, trailing closures, and @escaping closures? Do you know how to create custom operators. Do you truly understand the statement, "Swift is a protocol oriented programming language", and know how to use default protocols such as Equatable, Comparable, Sequence, and Iterator Protocol. Lastly, do you know the difference between normal and recursive enums? If you can't answer all of these questions, I recommend you to take this course and start learning with me.
Course Resources
Group Chat
Lecture Notes
Source Code
Explanations
Supporting Tutorials
Bob the Developer
Over thousands of daily visitors from students and iOS developers all around the world. Less than half a year, I became one of the top bloggers standing right next to big named brands. You don't have to question my quality of content. The growth and reputation speak for themselves.
p.s: Lecture notes, source code, explanations are available at any time. They are created, prepared, and edited by Bob the Developer.