targetEnvironment()
compiler condition do?Suggested approach: Get straight to the point and say it allows us to compile one set of code for the simulator, and another set of code for physical devices. Make sure and follow up with a practical example, such as a game that uses Core Motion to handle tilting movement on a real device, whereas on the simulator you need to tap the screen to simulate motion.
Estimated difficulty: Advanced
See the full list of iOS interview questions
Link copied to your pasteboard.