diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e02e549..cb7fa98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - name: Prepare Xcode uses: maxim-lobanov/setup-xcode@v1 # https://github.com/marketplace/actions/setup-xcode-version with: - xcode-version: 15.0.1 + xcode-version: 15.2.0 - name: Checkout uses: actions/checkout@v4 @@ -58,6 +58,14 @@ jobs: scheme: VSM destination: platform=tvOS Simulator,OS=17.0,name=Apple TV 4K (3rd generation) (at 1080p) action: test + + - name: Build and Test VSM on visionOS + uses: sersoft-gmbh/xcodebuild-action@v3 # https://github.com/marketplace/actions/xcodebuild-action + with: + spm-package: ./ + scheme: VSM + destination: platform=visionOS Simulator,OS=1.0,name=Apple Vision Pro + action: test # The following jobs are disabled until further notice to unblock work # Xcode currently has UI test runtime issues since Xcode 14.3 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 6200028..877b161 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -34,7 +34,7 @@ jobs: - name: Prepare Xcode uses: maxim-lobanov/setup-xcode@v1 # https://github.com/marketplace/actions/setup-xcode-version with: - xcode-version: 15.0.1 + xcode-version: 15.2.0 - name: Checkout uses: actions/checkout@v4 diff --git a/Package.swift b/Package.swift index 727e177..eb44bc9 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -9,7 +9,8 @@ let package = Package( .iOS(.v13), .macOS(.v11), .watchOS(.v6), - .tvOS(.v13) + .tvOS(.v13), + .visionOS(.v1) ], products: [ .library( diff --git a/Sources/VSM/StateObject+StateInit.swift b/Sources/VSM/StateObject+StateInit.swift index f02b2a1..70de2e2 100644 --- a/Sources/VSM/StateObject+StateInit.swift +++ b/Sources/VSM/StateObject+StateInit.swift @@ -12,6 +12,7 @@ import SwiftUI @available(iOS 14.0, *) @available(tvOS 14.0, *) @available(watchOS 7.0, *) +@available(visionOS 1.0, *) @available(*, deprecated, message: "Use the @ViewState property wrapper instead.") public extension StateObject { diff --git a/Sources/VSM/ViewState/RenderedViewState.swift b/Sources/VSM/ViewState/RenderedViewState.swift index 824205b..5e859df 100644 --- a/Sources/VSM/ViewState/RenderedViewState.swift +++ b/Sources/VSM/ViewState/RenderedViewState.swift @@ -53,6 +53,7 @@ import Combine /// } /// ``` @available(iOS 14.0, *) +@available(visionOS 1.0, *) @propertyWrapper public struct RenderedViewState { @@ -187,6 +188,7 @@ public struct RenderedViewState { // MARK: - RenderedViewState @available(iOS 14.0, *) +@available(visionOS 1.0, *) public extension RenderedViewState { /// Provides functions for observing and rendering state changes in UIKit views and view controllers struct RenderedContainer { @@ -236,6 +238,7 @@ public extension RenderedViewState { // Forwards protocol member calls to underlying state container @available(iOS 14.0, *) +@available(visionOS 1.0, *) extension RenderedViewState.RenderedContainer: StateObserving & StatePublishing { // MARK: StatePublishing diff --git a/Sources/VSM/ViewState/ViewState+Debug.swift b/Sources/VSM/ViewState/ViewState+Debug.swift index 9aa7bd4..a5336a0 100644 --- a/Sources/VSM/ViewState/ViewState+Debug.swift +++ b/Sources/VSM/ViewState/ViewState+Debug.swift @@ -7,9 +7,11 @@ #if DEBUG +@available(macOS 11, *) @available(iOS 14.0, *) @available(tvOS 14.0, *) @available(watchOS 7.0, *) +@available(visionOS 1.0, *) extension ViewState: _StateContainerStaticDebugging where State == Any { } #endif diff --git a/Sources/VSM/ViewState/ViewState.swift b/Sources/VSM/ViewState/ViewState.swift index 00a3f98..ff45c5d 100644 --- a/Sources/VSM/ViewState/ViewState.swift +++ b/Sources/VSM/ViewState/ViewState.swift @@ -31,9 +31,11 @@ import SwiftUI /// } /// } /// ``` +@available(macOS 11, *) @available(iOS 14.0, *) @available(tvOS 14.0, *) @available(watchOS 7.0, *) +@available(visionOS 1.0, *) @propertyWrapper public struct ViewState: DynamicProperty {