Let's add our first piece of logic using an if statement. An if statement is a simple statement to determine whether or not a statement is true. Input the following into Xcode:
![](https://static.packt-cdn.com/products/9781789348668/graphics/assets/f4c377ab-c645-4bec-afb6-d507d870fc7a.png)
In the first line of the preceding code, we created a constant named isPictureVisible, and we set it to true. The next line starts our if statement and reads as follows: if isPictureVisible is true, then print Picture is visible. When we write if statements, we must use the curly braces to enclose our logic. It is a good practice to put the opening curly brace ({) on the same line as the if statement and the closing curly brace (}) on the line immediately after your logic.
When writing if statements using a bool, you are always checking for true; however, if you wanted to check for false, you would do the following:
![](https://static.packt-cdn.com/products/9781789348668/graphics/assets/1ad0f8ee-9a31-4373-87d8-3edc9c15d4e3.png)
Bools work great with...