<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">In cases like this:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp;&nbsp;<span style="color: #ba2da2" class="">override</span> <span style="color: #ba2da2" class="">func</span> loadView() {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ba2da2" class="">super</span>.<span style="color: #3e1e81" class="">loadView</span>()</div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(79, 129, 135); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #703daa" class="">view</span><span style="color: #000000" class="">.</span><span style="color: #3e1e81" class="">addSubview</span><span style="color: #000000" class="">(</span>segmentedControl<span style="color: #000000" class="">)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #4f8187" class="">segmentedControl</span><span style="color: #000000" class="">.</span>translatesAutoresizingMaskIntoConstraints<span style="color: #000000" class=""> = </span><span style="color: #ba2da2" class="">false</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #4f8187" class="">segmentedControl</span><span style="color: #000000" class="">.</span>centerXAnchor<span style="color: #000000" class="">.</span><span style="color: #3e1e81" class="">constraint</span><span style="color: #000000" class="">(equalTo: </span>view<span style="color: #000000" class="">.</span>centerXAnchor<span style="color: #000000" class="">).</span>isActive<span style="color: #000000" class=""> = </span><span style="color: #ba2da2" class="">true</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; }</div></div><div class=""><br class=""></div><div class="">or</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(0, 132, 0); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">override</span> <span style="color: rgb(186, 45, 162);" class="">open</span> <span style="color: rgb(186, 45, 162);" class="">func</span> prepare(for segue: <span style="color: rgb(112, 61, 170);" class="">NSStoryboardSegue</span>, sender: <span style="color: rgb(186, 45, 162);" class="">Any</span>?) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<font color="#ba2da2" class="">if</font>&nbsp;<span style="color: rgb(186, 45, 162);" class="">let</span> destinationController = segue.destinationController&nbsp;<span style="color: rgb(186, 45, 162);" class="">as?</span> <span style="color: rgb(79, 129, 135);" class="">ScaleViewController {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #4f8187" class="">scaleViewController</span> = destinationController</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destinationController.<span style="color: #4f8187" class="">scalable</span> = <span style="color: #ba2da2" class="">self</span> <span style="color: #008400" class="">// weak back-link</span></div></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(79, 129, 135);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</span></div></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">super</span>.<span style="color: rgb(62, 30, 129);" class="">prepare</span>(for: segue, sender: sender)</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; }</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="background-color: rgb(255, 255, 255);" class="">We obviously need the ability to manually place the call to ‘</span><font color="#ba2da2" class="">super</font><span style="background-color: rgb(255, 255, 255);" class="">’ in our overridden methods, so we can’t just have the compiler always automatically call </span><font color="#ba2da2" class="">super</font><span style="background-color: rgb(255, 255, 255);" class=""> (like it does with dealloc).</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">But only occasionally do we need to pass in different parameters to the superclass method than were passed into us, and it’d be nice to ⑴ not have to do all the extra typing / reading in the common case, ⑵ makes it clear at a glance we’re calling the _same_ method on our superclass, not accidentally calling a different one, and ⑶ make it especially noticeable when we ARE changing the parameters around to our call to super by having that be the only version where you need to specify them.</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">So, for instance, the above two methods would turn into:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">override</span>&nbsp;<span style="color: rgb(186, 45, 162);" class="">func</span>&nbsp;loadView() {</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">super</span>()</div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(112, 61, 170);" class="">view</span><span style="color: rgb(0, 0, 0);" class="">.</span><span style="color: rgb(62, 30, 129);" class="">addSubview</span><span style="color: rgb(0, 0, 0);" class="">(</span>segmentedControl<span style="color: rgb(0, 0, 0);" class="">)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(112, 61, 170);" class=""><span style="color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(79, 129, 135);" class="">segmentedControl</span><span style="color: rgb(0, 0, 0);" class="">.</span>translatesAutoresizingMaskIntoConstraints<span style="color: rgb(0, 0, 0);" class="">&nbsp;=&nbsp;</span><span style="color: rgb(186, 45, 162);" class="">false</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(112, 61, 170);" class=""><span style="color: rgb(0, 0, 0);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(79, 129, 135);" class="">segmentedControl</span><span style="color: rgb(0, 0, 0);" class="">.</span>centerXAnchor<span style="color: rgb(0, 0, 0);" class="">.</span><span style="color: rgb(62, 30, 129);" class="">constraint</span><span style="color: rgb(0, 0, 0);" class="">(equalTo:&nbsp;</span>view<span style="color: rgb(0, 0, 0);" class="">.</span>centerXAnchor<span style="color: rgb(0, 0, 0);" class="">).</span>isActive<span style="color: rgb(0, 0, 0);" class="">&nbsp;=&nbsp;</span><span style="color: rgb(186, 45, 162);" class="">true</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;}</div></div><div class=""><br class=""></div><div class="">or</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(0, 132, 0);" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">override</span>&nbsp;<span style="color: rgb(186, 45, 162);" class="">open</span>&nbsp;<span style="color: rgb(186, 45, 162);" class="">func</span>&nbsp;prepare(for segue:&nbsp;<span style="color: rgb(112, 61, 170);" class="">NSStoryboardSegue</span>, sender:&nbsp;<span style="color: rgb(186, 45, 162);" class="">Any</span>?) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal; color: rgb(112, 61, 170);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<font color="#ba2da2" class="">if</font>&nbsp;<span style="color: rgb(186, 45, 162);" class="">let</span>&nbsp;destinationController = segue.destinationController&nbsp;<span style="color: rgb(186, 45, 162);" class="">as?</span>&nbsp;<span style="color: rgb(79, 129, 135);" class="">ScaleViewController {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(79, 129, 135);" class="">scaleViewController</span>&nbsp;= destinationController</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;destinationController.<span style="color: rgb(79, 129, 135);" class="">scalable</span>&nbsp;=&nbsp;<span style="color: rgb(186, 45, 162);" class="">self</span>&nbsp;<span style="color: rgb(0, 132, 0);" class="">// weak back-link</span></div></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="color: rgb(79, 129, 135);" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>}</span></div></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">super</span>()</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; }</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><br class=""></div></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">But this contrived example would stay the same:</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><div style="background-color: rgb(255, 255, 255); margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp;&nbsp;<span style="color: #ba2da2" class="">override</span> <span style="color: #ba2da2" class="">public</span> <span style="color: #ba2da2" class="">func</span> mouseDown(with event: <span style="color: #703daa" class="">NSEvent</span>) {</div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp; </span><font color="#ba2da2" style="background-color: rgb(255, 255, 255);" class="">let </font><font class="">someOtherEvent</font><font color="#ba2da2" style="background-color: rgb(255, 255, 255);" class=""> =&nbsp;…</font></div><div style="background-color: rgb(255, 255, 255); margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">super</span>.<span style="color: rgb(62, 30, 129);" class="">mouseDown</span>(with:&nbsp;someOtherEvent)</div><div style="background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; }</div></div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div class=""><span style="background-color: rgb(255, 255, 255);" class="">Note that I just made up a contrived example here because I couldn’t find a single real-world case in my 33,098 lines of Swift code where I call </span><font color="#ba2da2" class="">super</font><span style="background-color: rgb(255, 255, 255);" class="">.blah(…) with different parameters than the ones that were passed in, which I think also points to why this syntactic sugar is sweet and low-cal. (The only time I saw super being called&nbsp;with different parameters was in init() methods, where I was calling a different initializer.)</span></div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255);" class="">—</div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div class=""><span style="background-color: rgb(255, 255, 255);" class="">Another version would be to use a new word&nbsp;</span><span style="background-color: rgb(255, 255, 255);" class="">instead of “</span><font color="#ba2da2" class="">super</font><span style="background-color: rgb(255, 255, 255);" class="">()”, which doesn’t overload the noun-ish-ness of ‘</span><font color="#ba2da2" class="">super</font><span style="background-color: rgb(255, 255, 255);" class="">’:</span></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><div class=""><br class=""></div><div class=""><span style="color: rgb(186, 45, 162);" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>overridden</span><span style="background-color: rgb(255, 255, 255);" class="">()</span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class="">or</span></div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span><font color="#ba2da2" class="">superfunc</font><span style="background-color: rgb(255, 255, 255);" class="">()</span></div><div class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255);" class=""><div class="">It’s possible that the empty parenthesis in “<font color="#ba2da2" class="">super</font>()” would confuse readers into thinking some other version of their function is being called (that has no parameters), so it’s worth considering if something like “<font color="#ba2da2" class="">overridden</font>” by itself (no ()) would be better. I think if this is a worry I’d prefer to use three dots to indicate more stuff is going on here, to match with our documentation:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">super</span>(...)</div></div><div class=""><div class="">or</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<font color="#ba2da2" class="">overridden</font>(...)</div><div class=""><div class=""></div></div></div><div class=""><br class=""></div></div><div style="background-color: rgb(255, 255, 255);" class="">An orthogonal idea is for the contrived example would be to allow new parameters to be passed in directly without typing the function name again:</div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(186, 45, 162);" class="">super</span>(with:&nbsp;someOtherEvent)</div><div class=""></div></div><div style="background-color: rgb(255, 255, 255);" class="">or</div><div style="background-color: rgb(255, 255, 255);" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<font color="#ba2da2" class="">overridden</font>(with:&nbsp;someOtherEvent)</div><div class=""><div style="background-color: rgb(255, 255, 255);" class=""></div></div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="background-color: rgb(255, 255, 255);" class="">-Wil</div><div style="background-color: rgb(255, 255, 255);" class=""><br class=""></div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div></body></html>