rápido
#if (arch(i386) || arch(x86_64)) && os(iOS)
...
#endif
Después de Swift 4.1
#if targetEnvironment(simulator)
// your simulator code
#else
// your real device code
#endif
se puede escribir asi
#if TARGET_OS_IPHONE
#endif
#if !TARGET_IPHONE_SIMULATOR
#endif
referencia
ios: cómo detectar si la aplicación se está creando para un dispositivo o simulador en Swift