Welcome to the Swift Tutorials repository! This collection is tailored to help beginners and intermediate programmers learn Swift programming effectively. Swift is a powerful, intuitive programming language used widely for iOS, macOS, watchOS, and tvOS development. This repository provides a comprehensive guide to Swift, covering everything from the basics to advanced concepts. Each tutorial is designed to be easy to follow, helping you build a strong foundation in Swift.
Swift is known for its clarity, safety, and modern syntax, making it an excellent choice for developing apps across Apple's ecosystem. This repository covers a wide range of Swift topics, structured to build upon each other and ensure a smooth learning curve. Each topic is stored as a Swift Playground, allowing you to experiment and see your code in action.
Below is a list of the tutorials available in this repository. Each topic corresponds to a .playground
file, allowing you to easily explore and modify the code.
-
Naming Conventions, Commenting, and String Interpolation - here
Learn the standard naming conventions, effective commenting practices, and the basics of string interpolation in Swift. -
Variables - here
Understand how to declare and use variables in Swift. -
Arrays - here
Explore how to work with arrays, including declaration, accessing elements, and modifying values. -
Constants, Range Operator, and Randomization - here
Learn about constants, the range operator, and generating random numbers. -
Functions and Scope - here
Discover how to define functions, understand scope, and organize your code effectively. -
Functions with Inputs and Type Inference - here
Understand how to pass inputs to functions and leverage Swift's type inference. -
If-Else Control Flow - here
Learn about conditional statements and how to control the flow of your code. -
Switch Statements - here
Explore the switch statement for handling multiple conditions elegantly. -
Dictionaries - here
Understand dictionaries, including declaration, accessing values, and modifying contents. -
Defining and Unwrapping Optionals - here
Learn about optionals and how to safely unwrap them in Swift. -
Structures, Methods, and Properties - here
Discover the fundamentals of structures, methods, and properties. -
Functions with Outputs and Return Types - here
Understand functions that return values and how to define return types. -
Immutability - here
Learn the importance of immutability in Swift and how it improves code safety. -
Classes and Inheritance - here
Discover how to define classes, inheritance, and reuse code effectively. -
Structs vs. Classes - here
Understand the differences between structs and classes in Swift. -
Optional Binding, Chaining, and The Nil-Coalescing Operator - here
Learn how to handle optionals using binding, chaining, and the nil-coalescing operator. -
Protocols - here
Discover protocols and how they define a blueprint of methods and properties. -
Closures - here
Explore closures, a powerful concept for encapsulating blocks of code. -
Internal and External Parameter Names - here
Learn about parameter names in functions, and how to use internal and external names. -
Extensions and Default Implementations for Protocols - here
Extend types with additional functionalities using extensions, and provide default implementations for protocols. -
Loops - here
Discover various looping structures, includingfor
,while
, andrepeat-while
loops. -
Casting:
as?
,as!
, andis
- here
Learn how to cast types safely in Swift usingas?
,as!
, andis
. -
The Swift Singleton Object - here
Understand the singleton design pattern and how to implement it in Swift. -
The Swift Ternary Operator - here
Discover how to use the ternary operator for compact conditional expressions. -
Getters, Setters, Computed & Observed Properties - here
Explore computed properties, getters, setters, and property observers. -
Swift Access Levels, Structs vs. Classes, Swift Tuples, and Guard Let vs. If Let - here
Dive deeper into access control, Swift's unique features, and safe unwrapping of optionals.
Special thanks to Angela Yu for her excellent Swift tutorials on YouTube. Her clear and informative teaching style has served as a valuable resource in creating these materials. If you’re looking for additional learning resources, Angela's channel is highly recommended.
Contributions are welcome! If you have ideas for new tutorials or suggestions for improving existing ones, please feel free to fork the repository and create a pull request. Let’s learn and grow together in Swift programming! Happy coding!