<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 3, 2015, at 12:32 PM, Dan Stenmark <<a href="mailto:daniel.j.stenmark@gmail.com" class="">daniel.j.stenmark@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">There’s a some of debate in the community regarding best practice for asynchronous completion callbacks. These practices include:<div class=""><br class=""></div><div class="">- Single Block w/ Mutually Exclusive Result and Error Objects (the current standard convention in Cocoa, though originally designed with Objective-C in mind)</div><div class="">- Double Block (one for success, one for failure)</div><div class="">- Swift Enum w/ Associated Objects (as described here: <a href="http://www.developerdave.co.uk/2015/09/better-completion-handlers-in-swift/" class="">http://www.developerdave.co.uk/2015/09/better-completion-handlers-in-swift/</a>)</div><div class=""><br class=""></div><div class="">Even prior to Swift, Apple’s code guidelines never explicitly addressed this topic. Going forward into the brave new world of Swift, are there going to be new preferred API design guidelines for this?</div></div></div></blockquote><br class=""></div><div>This is a great point, and there are a number of other issues related to callbacks/closure arguments that would benefit from guidelines. For example, I've seen the “Double Block” case where the second block ends up being a trailing closure, which makes for non-intuitive uses.</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span>- Doug</div><div><br class=""></div><br class=""></body></html>