Categories
SwiftUI

SwiftUI Day 3 of 100 – Operators and conditions

Three days in a row and I’m still here. I felt a bit sharper today and was able to navigate most of the information without too many surprises. Loads of overlap here with most other languages I’ve worked with, which helps.

Conditionals without parentheses do look a bit strange to me – it’ll take some getting used to.

if firstCard > secondCard {
    print("First card wins")
}

Other things that jump to mind as being a bit different include the fallthrough command (?) within a switch statement, effectively being the opposite of PHP’s break in the same context. The ..< and ... range operators are new for me as well. Terse and straightforward – I like them.

References

Leave a Reply

Your email address will not be published. Required fields are marked *