[swift-evolution] [Proposal] Allow upgrading weak self to strong self by assignment

Kurt Werle kurt at circlew.org
Fri Feb 19 16:39:48 CST 2016

On Fri, Feb 19, 2016 at 2:30 PM, Shawn Erickson <shawnce at gmail.com> wrote:

> I get that :) but I think it would be helpful to go beyond the no-op case
> and help solve the "strongify" situation that exists in the larger problem
> domain.
OK - so what's wrong with:

> { [unowned self] in
>>   guard self != nil else {
>>     Do the other thing
>>   }
>> }
It's basically what you're asking for - an unowned implicitly unwrapped
variable followed by an else statement that takes care of the nil case.

kurt at CircleW.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160219/d8ffcc24/attachment.html>

More information about the swift-evolution mailing list