In UIKit and MVVM-style iOS code, closures are commonly used for callbacks, event handlers, and async completion blocks. If ownership is not handled carefully, they can keep objects alive longer than intended and cause memory leaks.
Explain how retain cycles happen when a view controller or view model stores a closure that captures self. In your answer, cover:
[weak self] versus [unowned self].self inside the closure after using a capture list.The interviewer expects a practical conceptual explanation rather than a full ARC deep dive. You should describe the memory ownership issue, show a small Swift example, explain the trade-offs between weak and unowned captures, and mention common cases such as async callbacks, stored closures, and bindings.