kbpontius
kbpontius

Reputation: 3917

Is Xcode 7 Debug Mode Working?

Using Xcode 7 Beta 3

The code below is failing to enter the #if DEBUG statement properly. I'm almost certain I'm in debug mode, but for some reason the following code isn't working:

#if DEBUG
    btnPrintPath.title! = "PrintPath"
#else
    btnPrintPath.title! = "" // EXECUTING THIS LINE.
#endif

My scheme looks like this: Build Scheme Configuration

I'm running the app with cmd + R.

Am I configuring this improperly?

Upvotes: 3

Views: 2292

Answers (1)

Aaron Brager
Aaron Brager

Reputation: 66234

Add -D DEBUG to "Swift Compiler - Custom Flags" -> "Other Swift Flags".

There's no official documentation that mentions this feature (you might want to file a radar for that) but I saw it used in this related answer.

Upvotes: 5

Related Questions