Posts from July 2018
In the previous post, we saw how the
SWIFT_ACTIVE_COMPILATION_CONDITIONSbuild setting can inject values in to our .swift files that we can use to conditionalize code depending on our active SDK and/or architecture.
When developing an app or a library, it’s pretty common that at least once in the course of development, you’ll need to conditionalize compilation of your code. Maybe you’ll be accounting for a bug in the operating system where things that don’t work quite the same on your device as they do on the simulator. Or perhaps you’ll want to simply exclude code from your simulator builds because the simulator simply doesn’t have that functionality (like invoking the camera).