Skip to content

Commit 7bf06f0

Browse files
Zandor300futuretap
authored andcommitted
Add simulator support.
1 parent 4424191 commit 7bf06f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

FTLinearActivityIndicator/Classes/UIDevice+Extension.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public extension UIDevice {
1616
guard let value = element.value as? Int8, value != 0 else { return identifier }
1717
return identifier + String(UnicodeScalar(UInt8(value)))
1818
}
19-
return identifier
19+
// When running in simulator, identifier will be one of "i386", "x86_64", "arm64" instead of what we want.
20+
switch identifier {
21+
case "i386", "x86_64", "arm64": return ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] ?? identifier
22+
default: return identifier
23+
}
2024
}
2125
}

0 commit comments

Comments
 (0)