Computers are like old testaments god, lots of rules and no mercy - Joseph Campbell
Today I learnt about:
- Arithmetic operators
- Operators overrloading
- Compound assignment operators
- Comparison operators
- Conditions
- Combining conditions (AND &&, OR ||)
- The ternary operator
- Switch statements
- Range operators
The summary of the entire day was:
- Swift has operators for doing arithmetic and for comparison; they mostly work like you already know.
- There are compound variants of arithmetic operators that modify their variables in place:
+=
,-=
, and so on. - You can use
if
,else
, andelse if
to run code based on the result of a condition. - Swift has a ternary operator that combines a check with true and false code blocks.
- If you have multiple conditions using the same value, it’s often clearer to use
switch
instead. - You can make ranges using
..<
and...
depending on whether the last number should be excluded or included.
That's All for the Day 3 of 100DaysOfSwiftUI!