… to check at runtime if app is running on simulator or device?This part of your question makes no sense. An app can't be built so that the same binary runs on the simulator and runs on the device, so it makes no sense to do a runtime check to see whether you're on the simulator or the device. Such a check would always be at compile time.However, to answer your question about the difference between TARGET_OS_SIMULATOR and TARGET_IPHONE_SIMULATOR, the former is the replacement for the latter, which is now deprecated. If you open <TargetConditionals.h> in the iOS 9.0 beta SDK, you'll see this comment: TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATORShare and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic:
Programming Languages
SubTopic:
Swift
Tags: