From 5a4ee49a37e0e9dd5d125b11798dc086b1da3d75 Mon Sep 17 00:00:00 2001 From: Nicko Maccharoli Date: Thu, 21 Sep 2023 08:24:49 +0900 Subject: [PATCH] Update to use targentEnv instead of older swift 3 method. --- Sources/DeviceFamily.swift | 2 +- Sources/UIDeviceExtensions.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/DeviceFamily.swift b/Sources/DeviceFamily.swift index 545ede2..30fc5d7 100644 --- a/Sources/DeviceFamily.swift +++ b/Sources/DeviceFamily.swift @@ -46,7 +46,7 @@ public enum DeviceFamily: String { extension DeviceFamily { public var isSimulator: Bool { - #if arch(i386) || arch(x86_64) + #if targetEnvironment(simulator) return true #else return false diff --git a/Sources/UIDeviceExtensions.swift b/Sources/UIDeviceExtensions.swift index e95c2a5..fa996ac 100644 --- a/Sources/UIDeviceExtensions.swift +++ b/Sources/UIDeviceExtensions.swift @@ -36,7 +36,7 @@ public extension UIDeviceComplete where Base == UIDevice { return identifier.flatMap { $0.type } ?? .unknown } - /// Specific model i.e iphone7 or iPhone7s + /// Get specific model name i.e `iPhone 15 Pro` var deviceModel: DeviceModel { return identifier.flatMap { DeviceModel(identifier: $0) } ?? .unknown }