<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 15 Dec 2015, at 22:48, Chuquimia, Max via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div dir="ltr" class=""><div class="markdown-here-wrapper" style=""><p style="margin:1.2em 0px!important" class="">What I propose is a natural way of assigning properties on <code class="" style="font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; display: inline; background-color: rgb(248, 248, 248);">layer</code> with a syntax we are all already used to:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class=""><code class="language-swift hljs" style="font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace; margin: 0px 0.15em; white-space: pre; overflow: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em; background-color: rgb(255, 255, 255); display: block !important; background-position: initial initial; background-repeat: initial initial;">someViewController.view.layer = [
    .shadowColor = <span class="hljs-type" style="color:rgb(92,38,153)">UIColor</span>.grayColor().<span class="hljs-type" style="color:rgb(92,38,153)">CGColor</span>,
    .shadowRadius = <span class="hljs-number" style="color:rgb(28,0,207)">5.0</span>,
    .shadowOffset = <span class="hljs-type" style="color:rgb(92,38,153)">CGSizeMake</span>(<span class="hljs-number" style="color:rgb(28,0,207)">0.0</span>, <span class="hljs-number" style="color:rgb(28,0,207)">0.5</span>),
    .shadowOpacity = <span class="hljs-number" style="color:rgb(28,0,207)">0.75</span>
]
</code></pre></div></div></div></blockquote><br class=""></div><div>You can already do something similar to this using blocks:<div class=""><br class=""><div class="">({</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>$0.shadowColor =&nbsp;UIColor.grayColor().CGColor</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>$0.shadowRadius = 5.0</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>$0.shadowOffset = CGSizeMake(0.0,&nbsp;0.5)</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>$0.shadowOpacity = 0.75</div><div class="">})(someViewController.view.layer)</div></div><div class=""><br class=""></div><div class="">or using optional unwrapping:</div><div class=""><br class=""></div><div class="">if let layer = someViewController.view.layer as CGLayer? {</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>layer.shadowColor =&nbsp;UIColor.grayColor().CGColor</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>layer.shadowRadius = 5.0</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>layer.shadowOffset = CGSizeMake(0.0,&nbsp;0.5)</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>layer.shadowOpacity = 0.75</div><div class="">}</div></div><br class=""></body></html>