Are trailing closures going to be obsolete with the new api-design-guidelines for Swift 3?
<p>I am in the process of converting a project to Swift 3 and picking up libraries that have already been converted to Swift 3. In the process I ran across this example in which the author code (<a href="https://github.com/sberrevoets/SDCAlertView" rel="nofollow">SDCAlertView</a>) changed a method call from </p>

<pre><code>addTextFieldWithConfigurationHandler(configurationHandler: (UITextField -&gt; Void)? = nil)
</code></pre>

<p>to:</p>

<pre><code>addTextField(withHandler configurationHandler: ((UITextField) -&gt; Void)? = nil)
</code></pre>

<p>Basically moving the withHandler part out of the method name and into the argument label. </p>

<p>It seems like this was done to be in line with the new <a href="https://swift.org/documentation/api-design-guidelines/" rel="nofollow">api-design-guidelines</a>.</p>

<p>So in Swift 2.x a call might look like this:</p>

<pre><code>alertController.addTextFieldWithConfigurationHandler() { tf in
  tf.placeholder = "email id"
  tf.keyboardType = .EmailAddress
  self.changePasswordForEmailId = tf
}
</code></pre>

<p>while in Swift 3 (or rather the newer version of the library) it would look like this: </p>

<pre><code>alertController.addTextField(withHandler: { tf in
  tf.placeholder = "email id"
  tf.keyboardType = .emailAddress
  self.changePasswordForEmailId = tf
})
</code></pre>

<p>or this:</p>

<pre><code>alertController.addTextField { tf in
  tf.placeholder = "email id"
  tf.keyboardType = .emailAddress
  self.changePasswordForEmailId = tf
}
</code></pre>

<p>So in this case if you want to use the more descriptive form that includes the role of the closure (a handler), you would loose the trailing closure syntax,  while using the trailing closure syntax you would loose the role information about the closure.</p>

<p>It seems to me in cases like this the method name and a trailing closure is really the better of the three options.</p>

<p>I did not notice anything in the new <a href="https://swift.org/documentation/api-design-guidelines/" rel="nofollow">api-design-guidelines</a> that specifically covers cases like this, did I miss something?  Can anyone point to documentation that would show preference to a particular implementation in a case like this?    </p>