Swift 4.1 之前
#if (arch(x86_64) || arch(i386)) && os(iOS)
// Simulator!
#endif
Swift 4.1 之后
#if targetEnvironment(simulator)
// Simulator!
#endif
Swift 4.1 之前
#if (arch(x86_64) || arch(i386)) && os(iOS)
// Simulator!
#endif
Swift 4.1 之后
#if targetEnvironment(simulator)
// Simulator!
#endif