Created
June 24, 2016 08:32
-
-
Save cmittendorf/106a5f8bad2814dff3c9a7d15b5653b7 to your computer and use it in GitHub Desktop.
Test in your iOS app, if your app is running in the Simulator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
struct Platform { | |
/// Check if the current platform is the simulator. | |
/// | |
/// - Returns: true if the current platform is the simulator | |
static let isSimulator: Bool = { | |
var isSim = false | |
#if arch(i386) || arch(x86_64) | |
isSim = true | |
#endif | |
return isSim | |
}() | |
} | |
print("\(Platform.isSimulator)") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment