There are some related questions but I have insufficient site reputation to comment on the existing threads, forcing me to start a new one. Sorry about that.
It appears Swift doesn't have a true preprocessor. Workarounds are possible using #if / #else / #endif, but the problem here is that it doesn't hide the 'false' portion from the compiler, forcing both the 'true' and 'false' parts to be syntactically valid. This is tough given that Swift 3 is syntactically incompatible with Swift 2 -- has anyone found a workaround that will allow creating code that can be compiled for either environment? (If XCode 8 beta allowed Swift 2.2, or if XCode 7.3.1 allowed Swift 3, that would also give me a workaround here).
What I'm trying to do, to give just one trivial example, is something like
#if SWIFT3
let session = WCSession.default()
#else
let session = WCSession.defaultSession()
#end
I can't find any way to do this, and it seems surprising that there isn't a way to do it given how completely incompatible Swift3 syntax is with Swift2.