All Programs (33)

Hello World

Print your first line of Swift code using the print() function.

Try it ▶

Sum of Two Numbers

Add two numbers and display the result.

Try it ▶

Day 2 — Basic types & conversions

Learn Swift data types and how to convert between them.

Try it ▶

If Else Example

Check if a number is even or odd using if-else.

Try it ▶

Day 3 — Operators & precedence

Understand arithmetic operators and their precedence.

Try it ▶

Day 4 — Control flow: if/switch

Use if statements and switch cases to control the program flow.

Try it ▶

Loop Example

Iterate over a range of numbers using a for loop.

Try it ▶

Day 5 — Loops: for, while, repeat-while

Practice different loops in Swift: for, while, and repeat-while.

Try it ▶

Day 6 — Functions basics

Learn how to define and call functions in Swift.

Try it ▶

Day 7 — Review / small project

Apply your knowledge to a small Swift project and review concepts.

Try it ▶

Day 8 — Arrays

Learn how to create arrays and find unique elements.

Try it ▶

Day 9 — Dictionaries & Sets

Work with dictionaries and sets to store key-value data.

Try it ▶

Day 10 — Optionals

Learn how to safely handle optional values in Swift.

Try it ▶

Day 11 — Enumerations

Define and use enums in Swift for type safety.

Try it ▶

Day 12 — Structs

Learn how to define structs and use mutating methods.

Try it ▶

Day 13 — Classes & reference semantics

Understand classes and how references work in Swift.

Try it ▶

Day 14 — Review + mini project

Combine learned concepts into a small project.

Try it ▶

Day 15 — Closures basics

Learn the basics of closures and how to use them.

Try it ▶

Day 16 — Higher-order functions

Practice map, filter, and reduce functions in Swift.

Try it ▶

Day 17 — Generics

Learn how to create generic types and functions.

Try it ▶

Day 18 — Protocols & extensions

Use protocols and extensions to define shared behavior.

Try it ▶

Day 19 — Property observers & computed properties

Observe changes to properties and define computed properties.

Try it ▶

Day 20 — Error handling & optionals

Handle errors using do-catch and optional unwrapping.

Try it ▶

Day 21 — Asynchronous basics

Learn completion handlers and asynchronous calls in Swift.

Try it ▶

Day 22 — Optionals advanced patterns

Practice optional chaining and flatMap for cleaner code.

Try it ▶

Day 23 — Generics advanced & associated types

Explore advanced generics and associated types in protocols.

Try it ▶

Day 24 — Performance considerations & value vs reference

Compare value vs reference types and optimize performance.

Try it ▶

Day 25 — Working with JSON

Learn to encode/decode JSON using Codable.

Try it ▶

Day 26 — File I/O (basic)

Read and write text files in Swift.

Try it ▶

Day 27 — Testing & debugging basics

Use print statements and unit testing for debugging.

Try it ▶

Day 28 — Design a CLI mini-project

Design a command-line interface project in Swift.

Try it ▶

Day 29 — Implement the mini-project

Complete the CLI project implementation.

Try it ▶

Day 30 — Review & next steps toward SwiftUI

Prepare for SwiftUI: learn @State, View protocol, and layout.

Try it ▶