diff --git a/src/swift/deviceIOS.swift b/src/swift/deviceIOS.swift index 9d29783..8e18a5e 100644 --- a/src/swift/deviceIOS.swift +++ b/src/swift/deviceIOS.swift @@ -1,13 +1,23 @@ import UIKit +var screenSize: CGSize { + guard let window = UIApplication.shared.connectedScenes.first as? UIWindowScene else { + return .zero + } + return window.screen.bounds.size +} + func printDeviceInfo() { let currentDevice = UIDevice.current print("[Device Info]") print("Name: \(currentDevice.name)") print("Model: \(currentDevice.model)") + print("IsSimulator: \(TARGET_OS_SIMULATOR != 0)") print("System Name: \(currentDevice.systemName)") print("System Version: \(currentDevice.systemVersion)") + print("Screen: \(screenSize.width) x \(screenSize.height)") + print("Locale: \(Locale.current)") if let identifierForVendor = currentDevice.identifierForVendor { print("Id For Vendor: \(identifierForVendor.uuidString)") } diff --git a/src/swift/deviceMacOS.swift b/src/swift/deviceMacOS.swift index 9118626..7e0a1fb 100644 --- a/src/swift/deviceMacOS.swift +++ b/src/swift/deviceMacOS.swift @@ -19,6 +19,8 @@ func printDeviceInfo() { if let cpu = sysctlByString(key: "machdep.cpu.brand_string") { print("CPU: \(cpu)") } + + print("Locale: \(Locale.current)") } func sysctlByString(key: String) -> String? {