ECS 189E: Android and iOS
Closures
Sam King, October 24th 2018
Administrative
Last time: finish up multiple navigation controllers
This time: closures
Next time: start our OS focus
End of Advanced Swift and iOS basics! Congratulations!
Administrative
Quiz on Friday will cover:
Closures and the designer’s goals
Basically the opposite of function pointers in C or regular expressions
Two different types of closures
General rule when reasoning about closures -- remember what the compiler knows and use that to infer what’s going on in your mind
Break into groups and tell me (1) if this is correct and if so what it does or (2) if this is incorrect why it’s incorrect
let _ = someArray.sorted(by: >)