Guest User

Untitled

a guest
Oct 21st, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. Control Structures
  2. ====
  3. Control structures are things you can put in your code to perform various logic operations. (i.e. perform a
  4. line of code multiple times)
  5.  
  6. There are a few but there are 2 important ones to know:
  7. - `if` statments
  8. - `for` loops
  9.  
  10. `if` Statements
  11. ----
  12. An if statment is simple. It takes a Boolean (`Bool` in Swift) and performs a block of code if that boolean is `true`.
  13. (remeber booleans are `true` or `false`).
  14.  
  15. ```swift
  16. let sampleValue = true
  17.  
  18. if sampleValue {
  19.  
  20. }
  21. ```
  22.  
  23. `for` Loops
  24. ----
  25.  
  26. if else else if only runs one
  27.  
  28. one else one if has to have if
  29.  
  30. array is a list of objects
  31.  
  32. literals
  33.  
  34. for loops
  35.  
  36. array append
Add Comment
Please, Sign In to add comment