> ## Content Index
> Fetch the complete content index at: https://www.justinw.me/llms.txt
> Use this file to discover other available public pages before exploring further.

# A Sane Reference for TargetConditionals
- URL: https://www.justinw.me/blog/targetconditionals/
- Published: 2016-06-26T11:08:36.000Z
- Updated: 2016-06-26T11:10:59.000Z
- Author: Justin Williams
- Tags: objective-c

I’ve spent the past couple days cleaning up some code to work on iOS, macOS, and watchOS. One thing I constantly struggle with is keeping the values I need from `TargetConditionals.h` in my head for when I want to `#if` branch a segment of Objective-C code for a specific platform.

So . . . I made a table.

Current as of: iOS 9.3, tvOS 9.2, watchOS 2.2, macOS 10.11

| Macro                         | 💻 device | 📱 device | 📱 simulator | ⌚️ device | ⌚️ simulator | 📺 device | 📺 simulator |
| ----------------------------- | --------- | --------- | ------------ | --------- | ------------ | --------- | ------------ |
| \`TARGET\_OS\_MAC\`           | ☑️        | ☑️        | ☑️           | ☑️        | ☑️           | ☑️        | ☑️           |
| \`TARGET\_OS\_IPHONE\`        | 🙅🏻      | ☑️        | ☑️           | ☑️        | ☑️           | ☑️        | ☑️           |
| \`TARGET\_OS\_IOS\`           | 🙅🏻      | ☑️        | ☑️           | 🙅🏻      | 🙅🏻         | 🙅🏻      | 🙅🏻         |
| \`TARGET\_OS\_WATCH\`         | 🙅🏻      | 🙅🏻      | 🙅🏻         | ☑️        | ☑️           | 🙅🏻      | 🙅🏻         |
| \`TARGET\_OS\_TV\`            | 🙅🏻      | 🙅🏻      | 🙅🏻         | 🙅🏻      | 🙅🏻         | ☑️        | ☑️           |
| \`TARGET\_OS\_SIMULATOR\`     | 🙅🏻      | 🙅🏻      | ☑️           | 🙅🏻      | ☑️           | 🙅🏻      | ☑️           |
| \`TARGET\_OS\_EMBEDDED\`      | 🙅🏻      | ☑️        | 🙅🏻         | ☑️        | 🙅🏻         | ☑️        | 🙅🏻         |
| \`TARGET\_IPHONE\_SIMULATOR\` | 🙅🏻      | 🙅🏻      | ☑️           | 🙅🏻      | ☑️           | 🙅🏻      | ☑️           |

Hopefully someone else finds this useful.