Swift
Completed
-
Section 1: Getting Started
-
Section 2: Core Syntax
-
Section 3: Optionals
-
Section 4: Object-Oriented and Value Types
-
Section 5: Memory Management
-
Section 6: Generics and Error Handling
-
Section 7: Concurrency
-
Section 8: Working with Collections
-
Section 9: Codable and Data Handling
-
Section 10: Protocol-Oriented Programming
-
Section 11: Testing and Tooling
-
Section 12: Practical Projects
-
Section 13: Interview Practice
-
Section 14: More Practice Exercises
-
Section 15: More Standard Library
-
Section 16: Advanced Concurrency
-
Section 17: Foundation Framework Deep Dive
-
Section 18: URLSession and Networking Deep Dive
-
Section 19: Combine Framework
-
Section 20: SwiftUI Fundamentals for Swift Developers
-
Section 21: Server-Side Swift with Vapor
-
Section 22: Swift Package Manager Deep Dive
-
Section 23: Swift Concurrency Deep Dive
-
Section 24: More Language Features
-
Section 25: Error Handling Deep Dive
-
Section 26: Testing Deep Dive
-
Section 27: Data Structures and Algorithms in Swift
-
Section 28: More Practice Exercises
-
Section 29: More Interview Practice
-
Section 30: Swift Macros (Swift 5.9+)
-
Section 31: Property Wrappers Ecosystem
-
Section 32: Swift Interop Deep Dive
-
Section 33: iOS App Architecture Patterns
-
Section 34: Performance and Debugging
-
Section 35: App Distribution and CI/CD
-
Section 36: More Practical Projects
-
Section 37: SwiftData and Persistence
-
Section 38: More Design Patterns
-
Section 39: More Review and Practice
-
Section 40: More Foundation Deep Dive
-
Section 41: Advanced Collections in Swift
-
Section 42: Advanced Generics Practice
-
Section 43: UIKit for Legacy and Hybrid Apps
-
Section 44: watchOS and visionOS Development Basics
-
Section 45: More Networking Patterns
-
Section 46: More Testing Practice
-
Section 47: Accessibility in Swift Apps
-
Section 48: Localization
-
Section 49: More Practical Projects Round 2
-
Section 50: Swift Charts Framework
-
Section 51: More Interview and Algorithm Practice
-
Section 52: Final Practice and Mastery
-
Section 53: Swift Compiler and Build System
-
Section 54: More Concurrency Practice
-
Section 55: App Store Guidelines and Review
-
Section 56: More Design and Architecture
1: Setting Up Xcode and Swift Playgrounds
Before we write a single line of logic, we have to deal with the tooling. You've likely already hit the App Store and started downloading Xcode. It's a massive download—sometimes a bit of a slog—but it's the only way to fly in the Swift ecosystem. Once it's installed, most beginners make the same mistake: they go to File > New > Project and start building a full-blown iOS app immediately.
The Friction of the Full Project
I’ve seen a lot of junior devs do this because they're eager to see something on a phone screen. But starting with a Project is the "naive" way to learn the language. When you create a project, Xcode generates a mountain of boilerplate. You get an AppDelegate, a ContentView, asset catalogs, and a complex build system that has to compile your entire app every time you want to test a small change.
Imagine you just want to figure out how to filter a list of usernames to find ones that start with the letter "A". In a full project, you'd have to write the logic, trigger a build, wait for the simulator to boot, and perhaps print the result to a console that you're still figuring out how to open. It’s a lot of ceremony for a very simple question. I call this "cognitive overhead"—you're spending more energy fighting the IDE than learning the language.
The Sandbox Approach
The better way, especially for this phase of your journey, is using a Swift Playground. Think of a Playground as a scratchpad. There is no "Build" phase in the traditional sense; you just write code, and the results appear instantly in the sidebar. I use Playgrounds even now, years into my career, whenever I need to prototype a complex algorithm before committing it to a production codebase.
To get one running, go to File > New > Playground and select the "Blank" template for macOS. Now, instead of navigating a file tree, you have a single page. If you want to test that username filter, you just write it and hit the "Play" button next to the line. It’s an iterative loop that takes milliseconds rather than minutes.
var users = ["Alice", "Bob", "Andrew", "Charlie"] let aUsers = users.filter { $0.hasPrefix("A") } print(aUsers) // Result appears immediately in the sidebarWhen the Sandbox Isn't Enough
Now, you might wonder why we'd ever go back to the "Project" way. The trade-off is that Playgrounds are isolated. They aren't meant for building actual apps that you can ship to the App Store. They don't handle the app lifecycle—like what happens when a user swipes the app away—and they can occasionally be buggy with complex memory management.
But for learning Swift? The speed of the feedback loop is everything. If you spend your first week wrestling with
Info.plistfiles and build targets, you're going to burn out. Stick to the Playground until we start talking about User Interfaces. Once we move into layouts and buttons, we'll migrate your logic into a real project structure.
📋 Practical Task
The Temperature Conversion Sandbox
Your goal is to set up your first Swift Playground and verify that your environment is working by building a simple logic test. Instead of a full app, create a Blank Playground and write a script that converts a list of Celsius temperatures into Fahrenheit.
Requirements:
- Create a
Blank Playground. - Define an array of doubles representing Celsius temperatures (e.g.,
[0.0, 20.0, 37.0, 100.0]). - Use a
for-inloop or amapfunction to calculate the Fahrenheit equivalent for each value using the formula:(Celsius * 9/5) + 32. - Print the final results to the console.
Verify that you can see the output in the right-hand sidebar (the Debug Area) without having to launch a simulator.
There are no comments for now.