How to check if an app is in the Simulator in Swift
Use #if targetEnvironment(simulator) #endif to determine if an app is being run in the simulator.
The code demonstrated above can be found in the Utils/System folder of our open source starter projects linked below.
Looking to learn more about Design and Technology?
Search our blog to learn more about design and technology.
Any Questions?
We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.