Beginning iOS 10 Part 1 Getting Started - Part 6: | Ray Wenderlich

If something changes, a good way to notify the user is through the use of alerts. This video will show you how to do that.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3760-beginning-ios-10-part-1-getting-started/lessons/6

In the closure you use “action in” what is the action referring to? Shouldn’t it be actionitem?

I’m always confused on when to use [weak self] in closures. I figure they are used to avoid circular strong references. What I’m not too clear on is in this video what is the strong circular reference that would be created if we did not use [weak self]? I’m assuming that:

presentViewController sets presentedViewController
and UIAlertAction with the closure sets a reference to self thus making things circular

What I don’t get is doesn’t the circular reference go away after alert is dismissed since presentedViewController becomes nil?