Lynda Course - Swift 5 Essential Thinking (Part 3)
So, predictably, it's been tough finding time this week. Knew it would happen with work becoming busier! So a quick-ish entry now. Next bit of Swift Essentials! Start Time - 20:46 4. Application Control Flow I love this! Probably my favourite aspect of Swift. Got enough time to complete this chapter as it's a short-ish one. var hp = 91 var maxHP = 100 // If statement (<, >, <=, >=, !=, ==) if hp < maxHP { print ( "Health is lower than the max health!" ) } else if hp <= 50 { print ( "Health is running seriously low!" ) } else { print ( "Health is not registered" ) } Optional Binding One interesting point is that the temporary value is only available within the if/let statement, not outside of that scope though! Another example with multiple values. Optional chaining - if let _ = isShopOpen , let searchedItem = blacksmithShop [ "Shield" ], le...