Skip to content

Instantly share code, notes, and snippets.

@jtbandes
Created November 14, 2015 20:44
Show Gist options
  • Save jtbandes/cd8ee0cf139ae4411b41 to your computer and use it in GitHub Desktop.
Save jtbandes/cd8ee0cf139ae4411b41 to your computer and use it in GitHub Desktop.

Values of macros from TargetConditionals.h.

Xcode 7 / iOS 9.1, tvOS 9.0, watchOS 2.0, OS X 10.11 SDKs

Macro 🖥 📱 📱sim ⌚️ ⌚️sim 📺 📺sim
TARGET_OS_MAC 1 1 1 1 1 1 1
TARGET_OS_IPHONE 0 1 1 1 1 1 1
TARGET_OS_IOS 0 1 1 0 0 0 0
TARGET_OS_WATCH 0 0 0 1 1 0 0
TARGET_OS_TV 0 0 0 0 0 1 1
TARGET_OS_SIMULATOR 0 0 1 0 1 0 1
TARGET_OS_EMBEDDED 0 1 0 1 0 1 0
TARGET_IPHONE_SIMULATOR 0 0 1 0 1 0 1

Xcode 6 / iOS 8.4, OS X 10.9 & 10.10 SDKs

Macro 🖥 📱 📱sim
TARGET_OS_MAC 1 1 1
TARGET_OS_IPHONE 0 1 1
TARGET_OS_EMBEDDED 0 1 0
TARGET_IPHONE_SIMULATOR 0 0 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment