Fix UI idiom in debug log
This commit is contained in:
parent
70c56f039f
commit
fab982bf81
|
@ -38,7 +38,7 @@ extension DebugLog {
|
|||
#if os(iOS)
|
||||
let device: UIDevice = .current
|
||||
osVersion = "\(device.systemName) \(device.systemVersion)"
|
||||
deviceType = "\(device.model) (\(device.userInterfaceIdiom))"
|
||||
deviceType = "\(device.model) (\(device.userInterfaceIdiom.debugDescription))"
|
||||
#else
|
||||
let os = ProcessInfo().operatingSystemVersion
|
||||
osVersion = "macOS \(os.majorVersion).\(os.minorVersion).\(os.patchVersion)"
|
||||
|
@ -67,3 +67,21 @@ extension DebugLog {
|
|||
return data
|
||||
}
|
||||
}
|
||||
|
||||
private extension UIUserInterfaceIdiom {
|
||||
var debugDescription: String {
|
||||
switch self {
|
||||
case .phone:
|
||||
return "Phone"
|
||||
|
||||
case .pad:
|
||||
return "Pad"
|
||||
|
||||
case .mac:
|
||||
return "Mac"
|
||||
|
||||
default:
|
||||
return "Other"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue