diff --git a/Sources/Xcore/SwiftUI/Components/Device/Biometrics.swift b/Sources/Xcore/SwiftUI/Components/Device/Biometrics.swift index 2e16d3b5a..031f3b9fe 100644 --- a/Sources/Xcore/SwiftUI/Components/Device/Biometrics.swift +++ b/Sources/Xcore/SwiftUI/Components/Device/Biometrics.swift @@ -97,6 +97,10 @@ public struct Biometrics { return kind } + if UserInterfaceIdiom.current == .vision { + return .opticID + } + return Device.screen.referenceSize.iPhoneXSeries ? .faceID : .touchID } } diff --git a/Sources/Xcore/SwiftUI/Components/Device/Device+Capability.swift b/Sources/Xcore/SwiftUI/Components/Device/Device+Capability.swift index cc9764d04..596b00df8 100644 --- a/Sources/Xcore/SwiftUI/Components/Device/Device+Capability.swift +++ b/Sources/Xcore/SwiftUI/Components/Device/Device+Capability.swift @@ -19,10 +19,11 @@ extension Device { public static let touchID = Capability(rawValue: 1 << 0) /// - SeeAlso: `Device.current.biometrics.isAvailable` and `Device.current.biometrics.kind`. public static let faceID = Capability(rawValue: 1 << 1) + /// - SeeAlso: `Device.current.biometrics.isAvailable` and `Device.current.biometrics.kind`. public static let opticID = Capability(rawValue: 1 << 2) public static let notch = Capability(rawValue: 1 << 3) public static let homeIndicator = Capability(rawValue: 1 << 4) - public static let iPhoneXSeries: Capability = [.notch, .faceID, .opticID, .homeIndicator] + public static let iPhoneXSeries: Capability = [.notch, .faceID, .homeIndicator] } } diff --git a/Sources/Xcore/SwiftUI/Components/Device/Device+Model.swift b/Sources/Xcore/SwiftUI/Components/Device/Device+Model.swift index 3d4bed0c8..ccaad9467 100644 --- a/Sources/Xcore/SwiftUI/Components/Device/Device+Model.swift +++ b/Sources/Xcore/SwiftUI/Components/Device/Device+Model.swift @@ -406,6 +406,9 @@ extension Device.Model { return UIDevice.current.model #elseif os(watchOS) return WKInterfaceDevice.current().model + #elseif os(visionOS) + #warning("TODO: Implement") + return "Apple Vision Pro" #elseif os(macOS) #warning("TODO: Implement") return "" diff --git a/Sources/Xcore/SwiftUI/Components/Device/Device.swift b/Sources/Xcore/SwiftUI/Components/Device/Device.swift index 48b1dbd66..ccf91829c 100644 --- a/Sources/Xcore/SwiftUI/Components/Device/Device.swift +++ b/Sources/Xcore/SwiftUI/Components/Device/Device.swift @@ -50,6 +50,8 @@ extension Device { return UIDevice.current.systemName #elseif os(watchOS) return WKInterfaceDevice.current().systemName + #elseif os(visionOS) + return "visionOS" #elseif os(macOS) #warning("TODO: Implement") return "macOS" diff --git a/Sources/Xcore/SwiftUI/Components/Device/UserInterfaceIdiom.swift b/Sources/Xcore/SwiftUI/Components/Device/UserInterfaceIdiom.swift index 521391bf7..8c7303ae9 100644 --- a/Sources/Xcore/SwiftUI/Components/Device/UserInterfaceIdiom.swift +++ b/Sources/Xcore/SwiftUI/Components/Device/UserInterfaceIdiom.swift @@ -34,22 +34,14 @@ public enum UserInterfaceIdiom: Hashable, CustomStringConvertible { public var description: String { switch self { - case .carPlay: - return "CarPlay" - case .mac: - return "Mac" - case .pad: - return "iPad" - case .phone: - return "iPhone" - case .tv: - return "Apple TV" - case .watch: - return "Apple Watch" - case .vision: - return "Apple Vision" - case .unspecified: - return "Unspecified" + case .carPlay: "CarPlay" + case .mac: "Mac" + case .pad: "iPad" + case .phone: "iPhone" + case .tv: "Apple TV" + case .watch: "Apple Watch" + case .vision: "Apple Vision" + case .unspecified: "Unspecified" } } } @@ -61,7 +53,7 @@ extension UserInterfaceIdiom { static var current: Self { #if targetEnvironment(macCatalyst) return .mac - #elseif os(iOS) || os(tvOS) + #elseif os(iOS) || os(tvOS) || os(visionOS) // swiftformat:disable indent switch UIDevice.current.userInterfaceIdiom { case .carPlay: diff --git a/Sources/Xcore/SwiftUI/Components/Popup/View+Popup.swift b/Sources/Xcore/SwiftUI/Components/Popup/View+Popup.swift index 6fecbe1c0..3ba214249 100644 --- a/Sources/Xcore/SwiftUI/Components/Popup/View+Popup.swift +++ b/Sources/Xcore/SwiftUI/Components/Popup/View+Popup.swift @@ -172,7 +172,7 @@ extension View { // MARK: - View Modifier -private struct PopupViewModifier: ViewModifier where PopupContent: View { +private struct PopupViewModifier: ViewModifier { init( isPresented: Binding, style: Popup.Style, diff --git a/Sources/Xcore/SwiftUI/Extensions/View+Window.swift b/Sources/Xcore/SwiftUI/Extensions/View+Window.swift index dde1f59a4..88554353f 100644 --- a/Sources/Xcore/SwiftUI/Extensions/View+Window.swift +++ b/Sources/Xcore/SwiftUI/Extensions/View+Window.swift @@ -64,7 +64,7 @@ extension View { // MARK: - Style /// A structure representing the style of a window. -public struct WindowStyle: Hashable { +public struct WindowStyle: Hashable, Sendable { /// A succinct label that identifies the window. public let label: String?