In the last demo, you updated the Fibonacci code to be a function that returns a digit in the sequence based on an input to the function. You also updated the code to make sure the input to the function is valid and doesn’t cause a crash.
You covered a lot of important topics in this lesson:
You learned about flow control and how to make your code branch using if-else and switch, and learned about the differences between them.
You learned about different kinds of loops: for, while, and repeat while. You also learned how to interrupt their flow using break and continue.
You learned about structuring your code with functions and how to pass inputs to a function. You learned how to adjust the naming so it’s easier to read the function and avoid confusion for the order of parameters. You saw how to receive an output from a function and learned about the defer statement.
In the next lesson, you’ll learn about some more building blocks that Swift uses: struct and class. You’ll also learn about important distinctions between struct and class. You’ll get a better understanding of how memory is used for your variables and how much space they take.
See forum comments
This content was released on Apr 24 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous: Function Demo
Next: Functions & Flow Control Quiz
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.