check if device is simulator ios 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