diff --git a/Package.swift b/Package.swift index c5d6f53..f1da4e2 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.9 import PackageDescription @@ -8,7 +8,8 @@ let package = Package( .iOS(.v15), .watchOS(.v8), .macOS(.v11), - .tvOS(.v15) + .tvOS(.v15), + .visionOS(.v1) ], products: [ .library( diff --git a/README.md b/README.md index 54f28b9..e0780ae 100644 --- a/README.md +++ b/README.md @@ -42,12 +42,13 @@ AppState is a Swift Package that simplifies the management of application state ### Requirements -- Swift 5.7 or later +- Swift 5.9 or later - iOS 15.0 or later - watchOS 8.0 or later - macOS 11.0 or later - tvOS 15.0 or later +- visionOS 1.0 or later ## Getting Started diff --git a/Sources/AppState/Application/Application+public.swift b/Sources/AppState/Application/Application+public.swift index b72c199..82b8945 100644 --- a/Sources/AppState/Application/Application+public.swift +++ b/Sources/AppState/Application/Application+public.swift @@ -438,7 +438,7 @@ public extension Application { // MARK: SyncState Functions -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) public extension Application { /// Resets the value to the inital value. If the inital value was `nil`, then the value will be removed from `iClouds` static func reset( diff --git a/Sources/AppState/Application/Application.swift b/Sources/AppState/Application/Application.swift index 291d6e0..7773c91 100644 --- a/Sources/AppState/Application/Application.swift +++ b/Sources/AppState/Application/Application.swift @@ -140,7 +140,7 @@ open class Application: NSObject, ObservableObject { - Note: Calling `Application.dependency(\.icloudStore).synchronize()` does not force new keys and values to be written to iCloud. Rather, it lets iCloud know that new keys and values are available to be uploaded. Do not rely on your keys and values being available on other devices immediately. The system controls when those keys and values are uploaded. The frequency of upload requests for key-value storage is limited to several per minute. */ - @objc @available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) + @objc @available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) open func didChangeExternally(notification: Notification) { Application.log( debug: """ diff --git a/Sources/AppState/Application/Types/Application+SyncState.swift b/Sources/AppState/Application/Types/Application+SyncState.swift index 7c45301..1b8f640 100644 --- a/Sources/AppState/Application/Types/Application+SyncState.swift +++ b/Sources/AppState/Application/Types/Application+SyncState.swift @@ -1,6 +1,6 @@ import Foundation -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) extension Application { /// The default `NSUbiquitousKeyValueStore` instance. public var icloudStore: Dependency { diff --git a/Sources/AppState/PropertyWrappers/SyncState.swift b/Sources/AppState/PropertyWrappers/SyncState.swift index 23abe54..5b97f85 100644 --- a/Sources/AppState/PropertyWrappers/SyncState.swift +++ b/Sources/AppState/PropertyWrappers/SyncState.swift @@ -17,7 +17,7 @@ import SwiftUI - Warning: Avoid using this class for data that is essential to your app’s behavior when offline; instead, store such data directly into the local user defaults database. */ -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) @propertyWrapper public struct SyncState: DynamicProperty { /// Holds the singleton instance of `Application`. @ObservedObject private var app: Application = Application.shared diff --git a/Tests/AppStateTests/SyncStateTests.swift b/Tests/AppStateTests/SyncStateTests.swift index ffd02c1..c664276 100644 --- a/Tests/AppStateTests/SyncStateTests.swift +++ b/Tests/AppStateTests/SyncStateTests.swift @@ -2,7 +2,7 @@ import SwiftUI import XCTest @testable import AppState -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) fileprivate extension Application { var syncValue: SyncState { syncState(id: "syncValue") @@ -13,19 +13,19 @@ fileprivate extension Application { } } -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) fileprivate struct ExampleSyncValue { @SyncState(\.syncValue) var count } -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) fileprivate struct ExampleFailureSyncValue { @SyncState(\.syncFailureValue) var count } -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) fileprivate class ExampleStoringViewModel: ObservableObject { @SyncState(\.syncValue) var count @@ -40,7 +40,7 @@ fileprivate class ExampleStoringViewModel: ObservableObject { } -@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, *) +@available(iOS 15.0, watchOS 9.0, macOS 11.0, tvOS 15.0, visionOS 1.0, *) final class SyncStateTests: XCTestCase { override class func setUp() { Application