Skip to content

Commit e4671aa

Browse files
committed
Fix simulator detection when compiled with Xcode 26
1 parent e5cbd69 commit e4671aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/AnalyticsKit/UserAndDeviceInfo/Platform.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ import Metal
44
/// Information about the current platform that the app is running on.
55
/// Is it a simulator, or device. Which device?
66
public enum Platform {
7-
public static var isSimulator: Bool { return TARGET_OS_SIMULATOR != 0 }
7+
public static var isSimulator: Bool {
8+
#if targetEnvironment(simulator)
9+
true
10+
#else
11+
false
12+
#endif
13+
}
814

915
/// Returns true if the code is running as part of a unit/integration test
1016
public static var isRunningTests: Bool {

0 commit comments

Comments
 (0)