File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,17 +27,15 @@ class System {
2727 static var name : String ? {
2828 var systemInfo = utsname ( )
2929 uname ( & systemInfo)
30-
31- if let identifier = String ( cString: & systemInfo. machine. 0 , encoding: . ascii) {
32- // Simulator Check
33- if identifier == " x86_64 " || identifier == " i386 " {
34- return ProcessInfo . processInfo. environment [ " SIMULATOR_MODEL_IDENTIFIER " ]
30+ let identifier = withUnsafePointer ( to: & systemInfo. machine, {
31+ $0. withMemoryRebound ( to: CChar . self, capacity: Int ( _SYS_NAMELEN) ) {
32+ ptr in String ( cString: ptr)
3533 }
36-
37- return identifier
34+ } )
35+ // Simulator Check
36+ if identifier == " x86_64 " || identifier == " i386 " || identifier == " arm64 " {
37+ return ProcessInfo . processInfo. environment [ " SIMULATOR_MODEL_IDENTIFIER " ]
3838 }
39-
40-
41- return nil
39+ return identifier
4240 }
4341}
You can’t perform that action at this time.
0 commit comments