<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="">Hello everyone,<div class=""><br class=""></div><div class="">It does seem like it is currently possible to wrap just the function declaration in an #if swift() directive like so:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#if</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">swift</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(>=</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">3.0</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">public</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> add(</span><span style="font-variant-ligatures: no-common-ligatures" class="">filter filterName: </span><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="color: rgb(112, 61, 170);" class="">String</span>, path: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#else // ERROR Expected ā}ā at end of brace statement</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">public</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">func</span><span style="font-variant-ligatures: no-common-ligatures;" class=""> addFilter(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">filterName: </span><span style="font-variant-ligatures: no-common-ligatures;" class=""><span style="color: rgb(112, 61, 170);" class="">String</span>, path: </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);" class="">String</span><span style="font-variant-ligatures: no-common-ligatures;" class="">) {</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Menlo; font-size: 11px; margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">#endif</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Is it possible Iām missing how to do this? This is particularly painful in Swift 3 given the change to move have labels on the first function parameter by default. As far as I can see it means that I am required to wrap the entire function body even if nothing else is incompatible with Swift 3.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Is this just an implementation detail that will be changed?</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Thanks,</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Tyler</span></div><div style="font-family: Menlo; font-size: 11px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""></div></span></div></span></div></div><div style="margin: 0px; line-height: normal;" class=""></div></span></div></div></body></html>