maybe no 14 look like this π€
for the best case
// BEST CASE:
class ViewController: UIViewController {
// Using weak self to avoid retain cycle
var completion: (() -> Void)? = nil
func setupClosure() {
completion = { [weak self] in
guard let self = self else { return }
// Now we can safely use self here
}
}
}