TL; DR? > Go to 3. Solution
1. Preprocessing in Swift
According to Apple's Pre-Processing Guidelines Documentation :
The Swift compiler does not include a preprocessor. Instead, it takes the advantage of compilation attributes, building configurations, and to implement the same functionality. For this reason, preprocessor directives are not imported into Swift.
This is why you have an error while trying to use __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0 , which is the C preprocessing directive. With swift, you simply cannot use #if with operators such as < . All you can do is:
#if [build configuration]
or with symbols:
#if [build configuration] && ![build configuration]
2. Conditional compilation
Again from the same documentation :
Assembly configurations include true and false literals, command line flags, and platform testing functions, as listed in the table below. You can specify command line flags using -D <#flag #>.
true and false : will not help us- platform testing functions :
os(iOS) or arch(arm64) > will not help you, search a little, they cannot determine where they are defined. (maybe in the compiler?) - command line flags . Here we say that the only option you can use ...
3. Decision
Feels like a workaround, but does the job: 
Now, for example, you can use #if iOSVersionMinRequired7 instead of __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0 , assuming, of course, that your goal is iOS7.
Basically, itβs the same as changing the target version of the iOS deployment in your project, which is less convenient ... Of course, you can use several build configurations with related circuits depending on the goals of your version of iOS.
Apple will certainly improve this, perhaps with some built-in function like os() ...