Q:

Any way to do true conditional compilation in Swift 3?

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.

A:

I can't find any way to do this

Nevertheless, there is one, and there has been one since Swift 2.2; they planned ahead for exactly this contingency:
https://github.com/apple/swift-evolution/blob/master/proposals/0020-if-swift-version.md
So, like this (I don't know what a WCSession is, so I used a different example):
    #if swift(>=3.0)
        let screen = UIScreen.main()
    #else
        let screen = UIScreen.mainScreen()
    #endif

EDIT According to Apple, Xcode 8 permits passing of arbitrary conditional compilation flags to Swift:

Active Compilation Conditions is a new build setting for passing conditional compilation flags to the Swift compiler. Each element of the value of this setting passes to swiftc prefixed with -D, in the same way that elements of Preprocessor Macros pass to clang with the same prefix. (22457329)

