<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On 13 Apr 2016, at 17:04, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">The biggest advantage of the<span class="Apple-converted-space"> </span><font face="Courier" class="">with</font><span class="Apple-converted-space"> </span>pattern IMO is Cocoa initializers. It provides a more unified </div><div class="">initialization scope. Instead of:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;"><font size="2" class=""><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">let</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space"> </span>questionLabel =<span class="Apple-converted-space"> </span></span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UILabel</span><span class="" style="font-variant-ligatures: no-common-ligatures;">()</span></font></div></div><div class=""><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><font size="2" class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">questionLabel</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">textAlignment</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space"> </span>= .</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">Center</span></font></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; line-height: normal; font-family: Menlo;"><font size="2" class=""><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(79, 129, 135);">questionLabel</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">font</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space"> </span>= <span class="Apple-converted-space"> </span></span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">UIFont</span><span class="" style="font-variant-ligatures: no-common-ligatures;">(name:</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);">"DnealianManuscript"</span><span class="" style="font-variant-ligatures: no-common-ligatures;">, size:<span class="Apple-converted-space"> </span></span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">72</span><span class="" style="font-variant-ligatures: no-common-ligatures;">)</span></font></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><font size="2" class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">questionLabel</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">text</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span></span><span class="" style="font-variant-ligatures: no-common-ligatures;">currentQuestion</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">text</span></font></div><div class="" style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);"><font size="2" class=""><span class="" style="font-variant-ligatures: no-common-ligatures;">questionLabel</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">numberOfLines</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="Apple-converted-space"> </span>=<span class="Apple-converted-space"> </span></span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);">0</span></font></div></div></div></blockquote></div><br class=""><div class="">Whilst I would not mind the <font face="Menlo" class="">`with`</font> pattern, it’s worth noting that Swift already has some very fine alternatives:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 172, 229);" class="">let</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> questionLabel: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(73, 162, 210);" class="">UILabel</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = {</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="font-variant-ligatures: no-common-ligatures; color: #c8ace5" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> $ = </span><span style="font-variant-ligatures: no-common-ligatures; color: #49a2d2" class="">UILabel</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro'; color: rgb(143, 121, 58);" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$.</span><span style="font-variant-ligatures: no-common-ligatures" class="">textAlignment</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = .</span><span style="font-variant-ligatures: no-common-ligatures; color: #49a2d2" class="">Center</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$.</span><span style="font-variant-ligatures: no-common-ligatures; color: #8f793a" class="">font</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #49a2d2" class="">UIFont</span><span style="font-variant-ligatures: no-common-ligatures" class="">(name:</span><span style="font-variant-ligatures: no-common-ligatures; color: #64961d" class="">"DnealianManuscript"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, size: </span><span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">72</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$.</span><span style="font-variant-ligatures: no-common-ligatures; color: #8f793a" class="">text</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #64961d" class="">"?"</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro'; color: rgb(143, 121, 58);" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$.</span><span style="font-variant-ligatures: no-common-ligatures" class="">numberOfLines</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #ff2600" class="">0</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro'; color: rgb(200, 172, 229);" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="font-variant-ligatures: no-common-ligatures" class="">return</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> $</span></font></div><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><font size="2" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}()</font></span></div><p style="margin: 0px; font-size: 12px; line-height: normal; font-family: 'Source Code Pro'; min-height: 15px;" class=""><br class=""></p><div class="">Including some lazy options:</div><p style="margin: 0px; font-size: 12px; line-height: normal; font-family: 'Source Code Pro'; min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 172, 229);" class="">private(set)</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 172, 229);" class="">lazy</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(200, 172, 229);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> questionLabel: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(73, 162, 210);" class="">UILabel</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> = {</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="color: rgb(203, 203, 203); font-variant-ligatures: no-common-ligatures;" class="">...</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span>}()</font></div><p style="margin: 0px; line-height: normal; font-family: 'Source Code Pro'; min-height: 15px;" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span><br class="webkit-block-placeholder"></font></p><div style="margin: 0px; line-height: normal; font-family: 'Source Code Pro';" class=""><font size="2" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="font-variant-ligatures: no-common-ligatures; color: #c8ace5" class="">static</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #c8ace5" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> questionLabel: </span><span style="font-variant-ligatures: no-common-ligatures; color: #49a2d2" class="">UILabel</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = {</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="color: rgb(203, 203, 203); font-variant-ligatures: no-common-ligatures;" class="">...</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span>}()</font></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div class="">milos</div><div class=""><br class=""></div></span></div></body></html>