Skip to content

Instantly share code, notes, and snippets.

@pokk
Created January 11, 2017 07:09
Show Gist options
  • Save pokk/ad091000406616275c8788baf54e2fea to your computer and use it in GitHub Desktop.
Save pokk/ad091000406616275c8788baf54e2fea to your computer and use it in GitHub Desktop.
Set preprocessors

Introduction

Make a preprocessor for convenient to switch code.

Step

1. Click the project
2. Click "TARGETS"
3. Click "Build Settings"
4. Search "Other Swift Flags"

In there you can add preprocessors what you want.

Setting ProjectName
Debug -DDEBUG
Release -DRELEASE
#if RELEASE
print("Hello world! release version")
#elseif DEBUG
print("Hello world! debug version")
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment