In this tutorial, you'll learn about if-statements, using which you can do certain things only if certain conditions are met. In plain English, if-statements correspond to “Do this; then do that.” or “If this condition is true, perform this action; otherwise, do that action.”
A good way to visualize if-statements is flow charts. If-statements represent the yes / no questions in the flowchart below.
We'll start with learning about a small concept called comments, which are useful for making your code more readable and easy to follow. Next, you'll learn how to compare things in Swift as well as the Boolean data type (values true and false). Finally, you will learn about if-statements