Skip to content

Commit 31fc02a

Browse files
Add bool to check if run on a simulator
1 parent 984ff81 commit 31fc02a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Source/UIDeviceExtensions.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public extension UIDevice {
2626
return parseDeviceModel(identifier)
2727
}
2828

29+
@objc
30+
var isSimulator: Bool {
31+
switch deviceModel {
32+
case .iPadSimulator, .iPhoneSimulator:
33+
return true
34+
default:
35+
return false
36+
}
37+
}
38+
2939
@objc
3040
public var isIpad: Bool {
3141
return deviceModel.name.contains("iPad")

0 commit comments

Comments
 (0)