Swift BasicsLesson 5Free preview
Swift Statements
This lesson is part of Swift · All levels
Summary
This lesson discusses the various types of statements in Swift that make up the logic controls of the program. Statements in Swift include assignment statements, constant declarations, conditional expressions, as well as control transfer statements such as guard and return that make the code more secure.
Key points
- Control flow statement sets the order of logical execution
- The statement 'guard' is used for early-exit if the prerequisites are not met
- The assignment statement evaluates the expression on the right and stores it on the left
- Control transfers include break, continue, fallthrough, and throw
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.