<div dir="ltr"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">Hi all</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">A South African in London here and I have decided to make the jump to trying to help </span><span class="inbox-inbox-lG" style="background-color:rgba(251,246,167,0.498039);outline:transparent dashed 1px;color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">Swift</span><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"> develop. </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">I was an android and web developer and </span><span class="inbox-inbox-lG" style="background-color:rgba(251,246,167,0.498039);outline:transparent dashed 1px;color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">swift</span><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"> converted me to iOS programming which has become something that I love. I have built several apps on iOS and on macOS using it and thoroughly enjoyed it. </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">One think has made me fall a little out of love with </span><span class="inbox-inbox-lG" style="background-color:rgba(251,246,167,0.498039);outline:transparent dashed 1px;color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">swift</span><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"> 3 was the removal of </span><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">completion handler argument labels </span><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">which has created:</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">1. Less maintainable code for teams </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">2. Less readable  and thus more error prone code </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">3. Slower code to write as now I have to regularly scroll to the top of the method to find out what the parameters should be . </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">4. Seems to be at odds with other parts of the api which favours labels. </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif"><span style="white-space:pre-wrap">I have found quite a lot of support from others via my stack overflow question here: </span></font><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif"><span style="white-space:pre-wrap"><a href="http://stackoverflow.com/questions/39613272/xcode-8-function-types-cannot-have-argument-label-breaking-my-build">http://stackoverflow.com/questions/39613272/xcode-8-function-types-cannot-have-argument-label-breaking-my-build</a></span></font><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;white-space:pre-wrap"><br>Here is my suggestion: </div><div>Currently the Swift 3 version does not allow arguments in the completionhandler method, which is confusing and not very readable.</div>






<p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><span class="inbox-inbox-Apple-converted-space">    </span></span><span class="inbox-inbox-s2">func</span><span class="inbox-inbox-s1"> myMethod(</span><span class="inbox-inbox-s2">_</span><span class="inbox-inbox-s1"> completionhandler:(</span><span class="inbox-inbox-s2">_</span><span class="inbox-inbox-s1"> downloadedValue:</span><span class="inbox-inbox-s3">String</span><span class="inbox-inbox-s1">,</span><span class="inbox-inbox-s2">_</span><span class="inbox-inbox-s1"> isActive:</span><span class="inbox-inbox-s3">Bool</span><span class="inbox-inbox-s1">, </span><span class="inbox-inbox-s2">_</span><span class="inbox-inbox-s1"> error:</span><span class="inbox-inbox-s3">NSError</span><span class="inbox-inbox-s1">)-&gt; </span><span class="inbox-inbox-s3">Void</span><span class="inbox-inbox-s1">) {<br></span><span class="inbox-inbox-s4"><span class="inbox-inbox-Apple-converted-space">        </span></span><span class="inbox-inbox-s1">//&lt;&lt;After doing some async method such as downloading from an API &gt;&gt;</span></p>
<p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><span class="inbox-inbox-Apple-converted-space">        </span>completionhandler(myString, </span><span class="inbox-inbox-s2">true</span><span class="inbox-inbox-s1">, myError)</span></p>
<p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><span class="inbox-inbox-Apple-converted-space">    </span>}<br></span><span class="inbox-inbox-s4"><span class="inbox-inbox-Apple-converted-space">    </span></span><span class="inbox-inbox-s1">// INSTEAD: ideally the argument labels should be added optionally to be called in the completion method such as below and using a Tuple-like syntax to indicate that the method should have the labels</span></p>
<p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><span class="inbox-inbox-Apple-converted-space">    </span></span><span class="inbox-inbox-s2">func</span><span class="inbox-inbox-s1"> myMethod(</span><span class="inbox-inbox-s2">_</span><span class="inbox-inbox-s1"> completionhandler:( downloadedValue:</span><span class="inbox-inbox-s3">String</span><span class="inbox-inbox-s1">, isActive:</span><span class="inbox-inbox-s3">Bool</span><span class="inbox-inbox-s1">,<span class="inbox-inbox-Apple-converted-space">  </span>error:</span><span class="inbox-inbox-s3">NSError</span><span class="inbox-inbox-s1">)-&gt; </span><span class="inbox-inbox-s3">Void</span><span class="inbox-inbox-s1">) {</span></p>
<p class="inbox-inbox-p3"><span class="inbox-inbox-s4"><span class="inbox-inbox-Apple-converted-space">        </span></span><span class="inbox-inbox-s1">//&lt;&lt;After doing some async method such as downloading from an API &gt;&gt;</span><br></p>
<p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><span class="inbox-inbox-Apple-converted-space">        </span>completionhandler(dowloadedValue:myString, isActive:</span><span class="inbox-inbox-s2">true</span><span class="inbox-inbox-s1">, error:myError)</span></p>
<p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><span class="inbox-inbox-Apple-converted-space">    </span>}</span></p><p class="inbox-inbox-p2"><span class="inbox-inbox-s1"><br></span></p><div><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">Thanks for the help ( and any feedback on my idea above ) </span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><br class="gmail_msg" style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap"><span style="color:rgb(33,33,33);font-family:&quot;helvetica neue&quot;,helvetica,arial,sans-serif;font-size:13px;white-space:pre-wrap">Thanks for the epic work you are doing ! </span><br></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Sent from my mobile </div></div>