how to check if simulator in swift code example
Example: swift test if simulator
#if targetEnvironment(simulator)
// your simulator code
#else
// your real device code
#endif
#if targetEnvironment(simulator)
// your simulator code
#else
// your real device code
#endif