Last active
August 22, 2018 21:51
-
-
Save rsaenzi/925abf3dbd28257778351d6000c14c8b to your computer and use it in GitHub Desktop.
To access default Xcode Build Configurations from code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BuildConfiguration.swift | |
// | |
// Created by Rigoberto Sáenz Imbacuán (https://www.linkedin.com/in/rsaenzi/) | |
// Copyright © 2017 Rigoberto Sáenz Imbacuán. All rights reserved. | |
// | |
// For this to work, please add on "Other Swift Flags" the following keys: | |
// Key -D BUILD_CONFIG_DEBUG for Debug | |
// Key -D BUILD_CONFIG_RELEASE for Release | |
class BuildConfiguration { | |
static var current: BuildConfigurationOption { | |
#if BUILD_CONFIG_RELEASE | |
return .release | |
#endif | |
#if BUILD_CONFIG_DEBUG | |
return .debug | |
#endif | |
} | |
static var isNotRelease: Bool { | |
return current == .debug ? true : false | |
} | |
} | |
enum BuildConfigurationOption { | |
case release | |
case debug | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment