Skip to content

Instantly share code, notes, and snippets.

@onmyway133
Forked from jtbandes/TargetConditionals.md
Created January 3, 2016 14:21
Show Gist options
  • Save onmyway133/d887a82f59b66e96c8e3 to your computer and use it in GitHub Desktop.
Save onmyway133/d887a82f59b66e96c8e3 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