Preprocessor conditional compilation

Swift 2.2
#if swift() >= 2.2

In order to make conditional code based on building in debug or the scheme, you need to add -D DEBUG yourself.

  1. Go to the file navigator, ⌘1
  2. Select the project (the first item)
  3. In the editor area, select the project and Build Settings
  4. Scroll all the way to the bottom, under Swift Compiler - Custom Flag
  5. Under Other Swift Flags, Debugging, add -D DEBUG
  6. The conditional code will look like this:
Swift 2.2
@IBAction func swipeAction(sender: UISwipeGestureRecognizer) {
    #if DEBUG
        priorElapsed = priorElapsed.advancedBy(10.0)
        print("swipe ignored in release mode")