Swift_Learning_Guide
Swift_Learning_Guide
Day 4: Functions
Topics to Learn:
- Function Definition and Calling
- Parameters and Return Values
- Default Parameters
Practice: Create a function to check if a number is prime.
Day 5: Collections
Topics to Learn:
- Arrays: Creating, modifying, and iterating
- Dictionaries: Key-value pairs
- Sets: Uniqueness of values
Practice: Build a dictionary of country names and their capitals.
Day 6: Optionals
Topics to Learn:
- What are Optionals?
- nil and Unwrapping Optionals
- Optional Binding with if let and guard let
Practice: Write a program that safely extracts a value from an optional dictionary.
Day 8: Enums
Topics to Learn:
- Defining Enums
- Associated Values
- Using Enums in Switch Statements
Practice: Create an enum to represent different types of beverages.