Skip to content

Instantly share code, notes, and snippets.

@pokk
Created January 12, 2017 01:37
Show Gist options
  • Save pokk/1b626abbf80cd1ebfb734dfd4251b35f to your computer and use it in GitHub Desktop.
Save pokk/1b626abbf80cd1ebfb734dfd4251b35f to your computer and use it in GitHub Desktop.
Set Xcode 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