Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Control Structures
- ====
- Control structures are things you can put in your code to perform various logic operations. (i.e. perform a
- line of code multiple times)
- There are a few but there are 2 important ones to know:
- - `if` statments
- - `for` loops
- `if` Statements
- ----
- An if statment is simple. It takes a Boolean (`Bool` in Swift) and performs a block of code if that boolean is `true`.
- (remeber booleans are `true` or `false`).
- ```swift
- let sampleValue = true
- if sampleValue {
- }
- ```
- `for` Loops
- ----
- if else else if only runs one
- one else one if has to have if
- array is a list of objects
- literals
- for loops
- array append
Add Comment
Please, Sign In to add comment