I am trying to use different environments for my application but facing issues doing it.
It's not the case that debug
is not working the case is none of the variables are working.
I am attaching a screenshot which will make it easier to understand what is happening.
I am not able to access any of the environments.
I ran this code in viewDidLoad
of initial view controller of my application and last else
condition gets executed.
#if DEBUG
print("Environment is debug")
#elseif debug
print("Environment is debug")
#elseif Debug
print("Environment is Debug")
#elseif RELEASE
print("Release")
#elseif PRODUCTION
print("Environment is production")
#elseif PROD
print("Environment is PROD")
#else
print("Environment is can't find")
#endif
Adding few more images for better clarity regarding schemes and Xcode settings.
In my case the issue was solved by adding DEBUG
as the debug Active Compilation Condition. I know it's already specified when you create a new project, but I don't remember if me or another team's member removed it (and why!). So I decided to put it here just in case someone else is facing the same scenario
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With