
In this introductory video, you'll be provided with a roadmap of the course. This lecture will cover the overall structure of the curriculum, briefly introducing each section and the topics to be covered. This overview is designed to give you a clear understanding of what you’ll learn and how each topic builds on the previous one, ensuring a smooth learning journey.
This lecture will guide you through setting up your development environment for Swift programming. You’ll learn how to download and install Xcode, Apple's IDE for macOS, and get an introduction to Playgrounds—a powerful tool within Xcode that allows you to write and execute Swift code interactively. By the end of this lecture, you'll have everything ready to start coding in Swift.
This lecture will introduce you to your first line of Swift code: the print function. You’ll learn how to output text to the console, which is the starting point for most programming tasks. The lecture will emphasize the importance of understanding how to display information and debug code by printing values.
Note " print can handle multiple parameters and complex data types, making it a versatile tool for debugging."
In this lecture, you will learn the difference between variables and constants in Swift. You’ll see how to declare them, assign values, and understand when to use a variable versus a constant.
This lecture introduces the basic data types in Swift, such as Int, Double, String, and Bool. You’ll learn how to declare variables and constants with specific types and understand the importance of type safety.
This lecture covers how to add comments to your code. You’ll learn about single-line and multi-line comments and why they are essential for making your code easier to understand and maintain.
In this lecture, you’ll explore how Swift infers types automatically and when to use explicit type annotations. You’ll understand the benefits of both approaches and how to apply them effectively in your code.
This lecture dives into working with strings in Swift. You’ll learn how to create strings, concatenate them, and use some of the most common string operations.
In this lecture, we'll introduce the fundamental concept of operators in programming. We'll explore what operators are, why they're essential, and how they serve as the building blocks for performing operations on data in Swift.
This lecture covers the basic arithmetic operators in Swift, such as addition, subtraction, multiplication, and division. We'll also delve into the modulo operator, which returns the remainder of a division.
This lecture will cover comparison operators such as ==, !=, >, <, >=, and <=. These operators are used to compare values and are fundamental in decision-making processes.
This lecture explores logical operators such as && (AND), || (OR), and ! (NOT). These operators are used to combine multiple conditions or to invert a condition.
In this lecture, we’ll introduce the concept of collection data types in Swift. We’ll discuss what collections are, why they are used, and the types of collections available in Swift, such as arrays, sets, tuples, and dictionaries.
This lecture will cover arrays in Swift. We’ll explore how to create arrays, access elements, modify arrays, and some useful array methods like append, insert, and remove.
In this lecture, we’ll explore tuples, a lightweight way to group multiple values into a single compound value. We'll learn how to create and use tuples and when they might be preferable over other collection types.
This lecture will cover dictionaries in Swift. We’ll explore how dictionaries store key-value pairs, how to create dictionaries, add and remove key-value pairs, and how to access and modify values.
This lecture will cover sets in Swift. We’ll explore how sets store unique values in an unordered collection, how to create sets, add and remove elements, and perform set operations like union, intersection, and difference.
In this lecture, we’ll introduce the concept of conditional statements, which are essential for controlling the flow of your program. We’ll discuss why conditions are important and how they allow you to make decisions in your code.
This lecture will dive deeper into the if statement, the simplest form of conditional statements. You’ll learn how to write if statements, how they work, and the importance of conditions in executing specific blocks of code.
In this lecture, you’ll learn about the if-else statement, which allows you to execute one block of code if a condition is true and another block if the condition is false.
This lecture will apply the knowledge of if and if-else statements through hands-on projects. You’ll work on small projects that reinforce the use of conditional statements in real-world scenarios.
This lecture will cover the switch statement, a powerful alternative to using multiple if-else statements. We’ll explore how to write switch statements, match cases, and how to use the default case to handle any unmatched conditions.
This lecture will provide hands-on projects to practice using switch statements. Projects may include tasks like building a simple grading system or a menu selection interface.
// Projects using Switch statement
/*
1. Simple Calculator:
Create a function that takes two numbers and an operator as input.
Use a switch statement to determine the operation based on the operator.
Perform the corresponding calculation and return the result.
2. Grade Calculator:
Create a function that takes a numerical grade as input.
Use a switch statement to assign a letter grade based on the numerical value.
Return the letter grade.
3. Day of the Week:
Create a function that takes a number representing the day of the week (1-7) as input.
Use a switch statement to return the corresponding day name.
4. Menu Selection:
Create a menu with options.
Use a switch statement to handle user input and perform the corresponding action.
5. Traffic Light:
Create a function that simulates a traffic light.
Use a switch statement to cycle through the different states (red, yellow, green).
6. Vowel or Consonant:
Create a function that takes a character as input.
Use a switch statement to determine if the character is a vowel or consonant.
7. Leap Year Checker:
Create a function that takes a year as input.
Use a switch statement to check if the year is a leap year based on the divisibility rules.
8. Number Word Converter:
Create a function that takes a single-digit number as input.
Use a switch statement to convert the number to its word equivalent.
9. Shape Area Calculator:
Create a function that takes a shape type and its dimensions as input.
Use a switch statement to calculate the area of the shape based on its type.
10. Month Name Converter:
Create a function that takes a number representing the month (1-12) as input.
Use a switch statement to return the corresponding month name.
*/
This lecture will introduce the ternary conditional operator (? :), a shorthand way of writing simple if-else statements in a single line.
This lecture introduces the concept of loops and iterations, which are crucial for executing a block of code multiple times. We'll explore the importance of loops in programming and when to use them to avoid repetitive code.
In this lecture, we'll dive deeper into the for loop, one of the most common loops in Swift. You'll learn how to use for loops to iterate over sequences like ranges, arrays, and more.
This lecture focuses on the while loop, which repeatedly executes a block of code as long as a specified condition is true. We'll explore scenarios where while loops are more appropriate than for loops.
This lecture covers the repeat-while loop, which is similar to the while loop but guarantees that the block of code is executed at least once before the condition is checked.
This lecture will introduce loop control statements, specifically break and continue, which allow you to alter the flow of loops. You'll learn how to exit a loop prematurely or skip the current iteration.
This lecture will introduce loop control statements, specifically break and continue, which allow you to alter the flow of loops. You'll learn how to exit a loop prematurely or skip the current iteration.
In this lecture, we'll explore the fundamental concept of functions in Swift. A function is a reusable block of code designed to perform a specific task. Understanding functions is crucial as they allow you to structure your code efficiently and avoid repetition.
Swift provides numerous built-in functions that can help you perform common tasks without writing code from scratch. This lecture introduces some of the most commonly used built-in functions in Swift.
This lecture focuses on the syntax of defining and calling functions in Swift. We'll break down the components of a function, such as the function name, parameters, and return type.
Void functions are functions that do not return a value. In this lecture, you'll learn how and when to use void functions effectively.
This lecture explores functions that return a value. You'll learn how to define return types and how to use these functions to obtain results from your code.
Parameters allow functions to accept inputs, making them more flexible and reusable. This lecture explains how to define and use parameters in Swift functions.
In Swift, a function can return multiple values using tuples. This lecture covers how to define functions that return multiple values.
Swift allows you to define external parameter names, making your function calls more readable. This lecture explains how to use external parameter names.
In some cases, you may want to omit the external parameter name for a cleaner function call. This lecture shows how to omit external names in Swift functions.
Default parameter values allow you to define a function with optional parameters. This lecture explains how to set default values for function parameters.
Functions in Swift have types, just like variables. This lecture covers function types and how to use them to assign functions to variables or pass them as arguments.
Variadic parameters allow you to pass a variable number of arguments to a function. This lecture explains how to use variadic parameters in Swift.
In-out parameters allow a function to modify the value of an argument passed to it. This lecture explains how to use in-out parameters effectively in Swift.
Optionals in Swift allow you to represent a variable that can either hold a value or no value (nil). This lecture introduces the concept of optionals, explains why they are important, and how they help in avoiding common runtime errors.
Optional binding is a way to safely unwrap an optional and access its value if it exists. This lecture covers how to use if let and guard let for optional binding in Swift.
// Optional Binding
// if let , guard let
// optional variable may or may not contain a value
// swift requires to unwrap the optional -> optional binding
// Optional binding
// If let
var firstName: String? = "ElAmir"
var lastName: String? = "Mansour"
if let unwrappedFirstName = firstName ,
let unwrappedLastName = lastName {// checks the value
print("") // excutes if name has a value
}else {
print("No name provided ") // if name is nil
}
// guard let
func greetUner (_ userName: String?){
guard let validName = userName else {
print("No Name provided . ")
return // early exit from function when var is nil
}
print("Welcome , \(validName)")
// i can use the unwrapped value many times in the function block
}
greetUner(nil)
greetUner("Elamir")
// Compare between if let and guard let .
Implicitly unwrapped optionals are a special type of optional that automatically unwraps when accessed. This lecture covers when and how to use implicitly unwrapped optionals.
Typealiases provide a way to give a new name to an existing type, making your code more readable. This lecture will explain how to create and use typealiases in Swift.
Closures are self-contained blocks of functionality that can be passed around and used in your code. This lecture introduces closures, explaining their significance, where they are used, and the basic concepts needed to understand them.
This lecture dives into the syntax of closures in Swift, covering how to write them, their different forms, and various examples to demonstrate their usage.
This lecture dives into the syntax of closures in Swift, covering how to write them, their different forms, and various examples to demonstrate their usage. remember it saves a lot of writing and time .
This lecture explains how Swift can infer types from context, allowing you to write even more concise closures.
Swift allows you to omit the return keyword in single-expression closures. This lecture explains when and how to use this feature.
Swift allows you to use operator functions directly as closures. This lecture covers how to replace long closures with operators for common operations.
Swift automatically provides shorthand argument names to inline closures, which can be used to refer to the values of the closure’s arguments by the names $0, $1, $2, and so on.
If you use these shorthand argument names within your closure expression, you can omit the closure’s argument list from its definition. The type of the shorthand argument names is inferred from the expected function type, and the highest numbered shorthand argument you use determines the number of arguments that the closure takes. The in keyword can also be omitted, because the closure expression is made up entirely of its body.
Lets say we've got $0 and $1 that means our highest numbered argument is $1 and the sorted method expects two arguments of the 'string' type so $0 and $1 will be used in our method .
to understand more watch the video again .
Trailing closures allow you to write cleaner code when the closure is the last parameter in a function call. This lecture explains how to use trailing closures effectively.
Autoclosures are a special type of closure that automatically wraps an expression in a closure. This lecture will cover how and when to use autoclosures in Swift.
To understand Closures or trailing closures specifically we can learn some of the higher order methods which are powerful in swift .
Higher-order functions are functions that can take other functions as parameters or return functions as results. In Swift, higher-order functions enable a functional programming style, allowing for more concise and expressive code.
The filter and map methods are examples of higher-order functions because they accept a closure (a function) as an argument to define their behavior. The closure specifies the condition for filtering or the transformation to be applied to each element.
الفهم؟ إذاً، هذه الدورة هي المكان المثالي لك!
في هذه الدورة الشاملة، سنتعلم أساسيات برمجة Swift بطريقة سلسة ومنظمة، بدءًا من إعداد بيئة العمل على جهازك، وكتابة أولى الأكواد، وصولاً إلى مفاهيم البرمجة المتقدمة مثل البرمجة الكائنية (OOP)، المغلقات (Closures)، وإدارة الأخطاء (Error Handling). ستنتهي الدورة بمشروع تطبيقي شامل لبناء تطبيق تجارة إلكترونية بسيط.
ما الذي ستتعلمه في هذه الدورة؟
مفاهيم أساسية في Swift: التعرف على أنواع البيانات، المتغيرات، الثوابت، العبارات الشرطية، والحلقات.
التحكم بالتدفق: فهم كيفية استخدام العبارات الشرطية وحلقات التكرار للتحكم في تدفق البرنامج.
البيانات المتعددة: التعامل مع المصفوفات، القواميس، والمجموعات.
الوظائف (Functions): كيفية كتابة الدوال واستخدام الأنواع المتعددة للمدخلات والمخرجات.
البرمجة الكائنية (OOP): فهم الكائنات والفئات، الوراثة، والتحكم بالوصول في Swift.
إدارة الأخطاء: التعامل مع الأخطاء واستخدام آليات Swift القوية لإدارتها.
مشروع نهائي: بناء تطبيق تجارة إلكترونية كامل كتطبيق عملي لما تعلمته خلال الدورة.
متطلبات الدورة:
جهاز Mac أو macOS مع تثبيت Xcode.
لا حاجة لخبرة سابقة، فهذه الدورة موجهة للمبتدئين وكل من يرغب في تعلم برمجة Swift من البداية.
لماذا تختار هذه الدورة؟
دروس مفهومة وسهلة: ستتعلم برمجة Swift بأسلوب سهل الفهم ومبني على الأمثلة العملية.
مشاريع عملية: الدورة تحتوي على مشاريع وتمارين تطبيقية لمساعدتك على فهم المفاهيم بشكل أعمق.
مهارات عملية: ستكتسب المهارات التي تحتاجها لتطوير تطبيقات iOS باستخدام Swift.