Skip to content

Commit 5e031cd

Browse files
committed
Add traitCollection.push(state:)
1 parent feaa4d0 commit 5e031cd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Sources/ComposableArchitecture/UIKit/NavigationStackControllerUIKit.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import UIKit
33

44
extension NavigationStackController {
5-
65
/// Drives a navigation stack controller with a store.
76
///
87
/// See the dedicated article on <doc:Navigation> for more information on the library's
@@ -69,4 +68,13 @@
6968
}
7069
}
7170
}
71+
72+
@available(iOS 17, macOS 14, tvOS 17, watchOS 10, *)
73+
@MainActor
74+
extension UIPushAction: Sendable {
75+
public func callAsFunction<Element: Hashable>(state: Element) {
76+
@Dependency(\.stackElementID) var stackElementID
77+
self(value: StackState.Component(id: stackElementID(), element: state))
78+
}
79+
}
7280
#endif

0 commit comments

Comments
 (0)