While going through the book, a question popped up:
When I declare a self
property inside a closure of a function in a UIViewController
class, I make it unowned
. The rationale is that for the lifetime of the VC, self
cannot be nil
.
I see that in the book, you declare it mostly as a weak
variable (for example in Chapter 6 and in other places). Is my rationale wrong while declaring self
as unowned
instead of weak
, or is there a specific reason you do it that way?