EZ

Eduzan

Learning Hub

Eduzan
Eduzan / Swift

Swift Control Flow

Decision-making statements in Swift allow the program to choose a specific block of code to execute based on a given condition. These statements evaluate conditions and return a boolean value (true or false). If the condition is true, the associated block of code is executed; otherwise, an alternate block is executed. Swift supports five types of decision-making statements:

1. Simple if
2. if-else
3. if-else if-else
4. Nested if
5. Switch

End of lesson.