weak
and unowned
?Suggested approach: As well as explaining that weak
becomes a regular optional whereas unowned
is an implicitly unwrapped optional, be prepared to discuss the safety differences. Do you have a preference? If so, why? Can you think of places where unowned
must be used?
Estimated difficulty: Intermediate
Watch me answer this question in detail
See the full list of iOS interview questions
defer
keyword in Swift?
final
keyword do, and why would you want to use it?
return
keyword?
Link copied to your pasteboard.