Skip to content

Commit 5de9bd5

Browse files
authored
Merge pull request #112 from seasox/master
Check for targetEnvironment(simulator) if swift(>=4.1)
2 parents e315952 + 625623a commit 5de9bd5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Sources/Helpers/Functions.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,17 @@ func localizedString(_ key: String) -> String {
3737

3838
/// Checks if the app is running in Simulator.
3939
var isSimulatorRunning: Bool = {
40-
#if (arch(i386) || arch(x86_64)) && os(iOS)
41-
return true
40+
#if swift(>=4.1)
41+
#if targetEnvironment(simulator)
42+
return true
43+
#else
44+
return false
45+
#endif
4246
#else
43-
return false
47+
#if (arch(i386) || arch(x86_64)) && os(iOS)
48+
return true
49+
#else
50+
return false
51+
#endif
4452
#endif
4553
}()

0 commit comments

Comments
 (0)