To be able to do anything interesting, a Swift program needs to take decisions based on whether some condition is true or not. This is done through conditionals.
Swift has several conditionals. The most common one is the if statement, which we will cover in this article.
Cosmin has been writing tutorials and books on Swift and iOS development since 2014, when the first version of Swift was released. He has been part of influential iOS development communities such as raywenderlich.com and appcoda.com since 2010 and has taught iOS development with Objective-C and Swift since 2012. Cosmin lives in Romania and has engineering degrees in electronics, telecommunications, neural networks, microprocessors, microcontrollers, distributed systems, and web technologies from the technical universities of Cluj-Napoca and Iași. He has worked with many programming languages over the years, but none of them has had such a significant impact on himself as Swift. Cosmin likes to play the guitar or study WW2 history when not coding