<div dir="ltr">Arg!  My mistake - I did not realize you can&#39;t test an unowned to be nil like you can an implicitly unwrapped variable.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 11:03 PM, Shawn Erickson <span dir="ltr">&lt;<a href="mailto:shawnce@gmail.com" target="_blank">shawnce@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">True, however only if unowned works in terms of the desired object life time / &quot;ownership&quot; for self. It isn&#39;t always sufficient so weak is needed to avoid the retain cycle while safely supporting self becoming nil (e.g. allowing the object referenced by self to go away while the block may still be outstanding). The proposal outlines at least one example of that need and is written assuming you need to use weak.<div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 19, 2016 at 10:15 PM Kurt Werle &lt;<a href="mailto:kurt@circlew.org" target="_blank">kurt@circlew.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 19, 2016 at 9:04 PM, Evan Maloney <span dir="ltr">&lt;<a href="mailto:emaloney@gilt.com" target="_blank">emaloney@gilt.com</a>&gt;</span> wrote:</div><div class="gmail_quote"><div><br></div><div>... </div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)">With this feature, the code above could be rewritten as:</p><div style="margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)"><pre style="overflow:auto;font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;background-color:rgb(247,247,247)">networkRequest<span style="color:rgb(167,29,93)">.</span>fetchData() { [<span style="color:rgb(167,29,93)">weak</span> <span style="color:rgb(167,29,93)">self</span>] result <span style="color:rgb(167,29,93)">in</span>
    <span style="color:rgb(167,29,93)">guard</span> <span style="color:rgb(167,29,93)">let</span> <span style="color:rgb(167,29,93)">self</span> <span style="color:rgb(167,29,93)">=</span> <span style="color:rgb(167,29,93)">self</span> <span style="color:rgb(167,29,93)">else</span> { <span style="color:rgb(167,29,93)">return</span> }</pre></div></div></div></blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If you&#39;re going to have boilerplate like that, then the following seems like it accomplishes the same thing [in this specific case] without changing anything:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div style="margin-bottom:16px;color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,&#39;Segoe UI&#39;,Arial,freesans,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px"><pre style="overflow:auto;font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:14px;margin-top:0px;margin-bottom:0px;line-height:1.45;padding:16px;border-radius:3px;word-wrap:normal;background-color:rgb(247,247,247)">networkRequest<span style="color:rgb(167,29,93)">.</span>fetchData() { [<span style="color:rgb(167,29,93)">unowned</span> <span style="color:rgb(167,29,93)">self</span>] result <span style="color:rgb(167,29,93)">in</span>
    <span style="color:rgb(167,29,93)">guard</span> <span style="color:rgb(167,29,93)">self</span> !<span style="color:rgb(167,29,93)">=</span> <span style="color:rgb(167,29,93)">nil</span> <span style="color:rgb(167,29,93)">else</span> { <span style="color:rgb(167,29,93)">return</span> }</pre></div></div></blockquote></div><div> </div><div>Kurt</div></div></div></div><div dir="ltr"><div class="gmail_extra">-- <br><div>kurt@CircleW.org<br><a href="http://www.CircleW.org/kurt/" target="_blank">http://www.CircleW.org/kurt/</a><br></div>
</div></div></blockquote></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">kurt@CircleW.org<br><a href="http://www.CircleW.org/kurt/" target="_blank">http://www.CircleW.org/kurt/</a><br></div>
</div>