mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-08 08:52:05 +00:00
Fix UI idiom in debug log
This commit is contained in:
parent
70c56f039f
commit
fab982bf81
@ -38,7 +38,7 @@ extension DebugLog {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
let device: UIDevice = .current
|
let device: UIDevice = .current
|
||||||
osVersion = "\(device.systemName) \(device.systemVersion)"
|
osVersion = "\(device.systemName) \(device.systemVersion)"
|
||||||
deviceType = "\(device.model) (\(device.userInterfaceIdiom))"
|
deviceType = "\(device.model) (\(device.userInterfaceIdiom.debugDescription))"
|
||||||
#else
|
#else
|
||||||
let os = ProcessInfo().operatingSystemVersion
|
let os = ProcessInfo().operatingSystemVersion
|
||||||
osVersion = "macOS \(os.majorVersion).\(os.minorVersion).\(os.patchVersion)"
|
osVersion = "macOS \(os.majorVersion).\(os.minorVersion).\(os.patchVersion)"
|
||||||
@ -67,3 +67,21 @@ extension DebugLog {
|
|||||||
return data
|
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
Block a user