Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Resolver/Resolver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// THE SOFTWARE.
//

#if os(iOS)
#if os(iOS) || os(visionOS)
import UIKit
import SwiftUI
#elseif os(macOS) || os(tvOS) || os(watchOS)
Expand Down Expand Up @@ -877,15 +877,15 @@ public extension UIViewController {
}
}

#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS) || os(visionOS)
/// Immediate injection property wrapper for SwiftUI ObservableObjects. This wrapper is meant for use in SwiftUI Views and exposes
/// bindable objects similar to that of SwiftUI @observedObject and @environmentObject.
///
/// Dependent service must be of type ObservableObject. Updating object state will trigger view update.
///
/// Wrapped dependent service is resolved immediately using Resolver.root upon struct initialization.
///
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, visionOS 1.0, *)
@propertyWrapper public struct InjectedObject<Service>: DynamicProperty where Service: ObservableObject {
@ObservedObject private var service: Service
public init() {
Expand Down