NEW: Start my new Ultimate Portfolio App course with a free Hacking with Swift+ trial! >>

DAY 3

Operators and conditions


Today we’re going to get into the real detail of Swift: operators and conditions. This can sometimes trip folks up when they are learning, because as Joseph Campbell once said, “computers are like Old Testament gods: lots of rules and no mercy.”

Don’t worry, though. Sure, if you get a condition wrong then your code might not work at first, but it costs nothing other than a little head scratching to fix it up and try again.

Today you have ten one-minute videos to watch, and you’ll meet things like operator overloading, switch statements, and more. After watching each video you’re welcome to go through the optional extra reading if you want, and as always there’s a short test to help make sure you’ve understood what was taught.

  1. Arithmetic Operators
  2. Operator overloading
  3. Compound assignment operators
  4. Comparison operators
  5. Conditions
  6. Combining conditions
  7. The ternary operator
  8. Switch statements
  9. Range operators
  10. Operators and conditions summary

Have some questions about operators?

Hit Send below to start a virtual conversation with me.

You’ve finished day three now, and you’re starting to write useful Swift code – make sure to tell the world about your progress!

Need help? Tweet me @twostraws!

 

Hacking with Swift is sponsored by Instabug

SPONSORED Catch bugs as soon as they happen and know exactly why a crash occurred. Instabug's SDK grabs all the logs they need to fix bugs, crashes and performance issues in minutes instead of days. Get screenshots, device details, network logs, repro steps, and tons of other critical insights needed to resolve issues and prioritize product backlogs straight from your dashboard. It only takes a minute to integrate!

Get started now

Sponsor Hacking with Swift and reach the world's largest Swift community!

100 Days of Swift


The 100 Days of Swift is a free collection of videos, tutorials, tests, and more to help you learn Swift faster. Click here to learn more, or watch the video below.

Back to 100 Days of Swift

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.