1/25
These flashcards cover key vocabulary related to control flow and enumerations in Swift programming.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
for-in loop
A control flow statement used to iterate over sequences such as arrays, dictionaries, or ranges.
while loop
A control structure that repeatedly executes a block of code as long as a specified condition is true.
repeat-while loop
A variant of the while loop that executes the block of code at least once before checking the condition.
if statement
A conditional statement that executes a block of code only if a specified condition is true.
switch statement
A control flow statement that evaluates a value and compares it against multiple patterns, executing the corresponding block of code.
continue statement
A control transfer statement that tells a loop to skip the current iteration and start the next.
break statement
A control transfer statement that terminates the execution of the current control flow statement.
Control Transfer Statements
Statements that change the order of execution in your code.
enum
A data type that defines a common type for a group of related values, allowing type-safe usage within the code.
associated values
Values that allow enumeration cases to store additional information of any type.
CaseIterable
A protocol that enables an enumeration to expose a collection of all its cases.
for-in loop
A control flow statement used to iterate over sequences such as arrays, dictionaries, or ranges.
while loop
A control structure that repeatedly executes a block of code as long as a specified condition is true.
repeat-while loop
A variant of the while loop that executes the block of code at least once before checking the condition.
if statement
A conditional statement that executes a block of code only if a specified condition is true.
switch statement
A control flow statement that evaluates a value and compares it against multiple patterns, executing the corresponding block of code.
continue statement
A control transfer statement that tells a loop to skip the current iteration and start the next.
break statement
A control transfer statement that terminates the execution of the current control flow statement.
Control Transfer Statements
Statements that change the order of execution in your code.
enum
A data type that defines a common type for a group of related values, allowing type-safe usage within the code.
associated values
Values that allow enumeration cases to store additional information of any type.
CaseIterable
A protocol that enables an enumeration to expose a collection of all its cases.
guard statement
A control flow statement in Swift that ensures a condition is true, or exits the current scope if false, providing an early exit.
Raw Values (enums)
Pre-populated values of a specific type (e.g., Int, String) that can be assigned to each case of an enumeration.
Labeled Statements
A way to give a loop or conditional statement a human-readable label, allowing break or continue statements to exit or skip specific outer control flow statements.
default case (switch)
A required case in a switch statement that matches any value not already handled by other cases, ensuring exhaustive pattern matching.