Can I set build configurations in Swift code?
Can I set build configurations in Swift code?
- Subject: Can I set build configurations in Swift code?
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 08 Jul 2014 10:50:39 +0700
In Objective-C I like to do things like:
#if DEBUG
#define SOME_FLAG
//#define OTHER_FLAG
#endif
[...]
#ifdef SOME_FLAG
[...]
#endif
[...]
#ifdef OTHER_FLAG
[...]
#endif
In Swift I am doing:
#if DEBUG
let SOME_FLAG = true
let OTHER_FLAG = false
#endif
#if DEBUG
if SOME_FLAG
{
[...]
}
#endif
Works fine.
But: I get lots of warnings "Will never be executed" for all OTHER_FLAGs.
I do NOT want to switch off this warning, as it probably is rather useful.
But I do much prefer to have code which compiles without warnings.
So: is there a way to define build configurations in code (other than in the Build Settings of Xcode) ?
Or: how else to handle conditionally compiled code in Swift?
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden