Suggested approach: Closures are easy to begin with, but make sure you talk about capturing of values, capture lists (unowned
vs weak
), and why they are actually useful compared to other approaches. It’s possible your interviewer is looking for a broader discussion of functions as first-class types in Swift, so if they seem to be waiting for you to continue that might be a good angle to go down.
Estimated difficulty: Intermediate
See the full list of iOS interview questions
if let
and guard let
?
final
keyword do, and why would you want to use it?
weak
and unowned
?
Link copied to your pasteboard.