11#if !os(watchOS)
22@_spi ( Advanced)
3- public struct IntrospectionSelector < Target: PlatformEntity > {
3+ public struct IntrospectionSelector < Target: PlatformEntity > : Sendable {
44 @_spi ( Advanced)
55 public static var `default` : Self { . from( Target . self, selector: { $0 } ) }
66
77 @_spi ( Advanced)
8- public static func from< Entry: PlatformEntity > ( _ entryType: Entry . Type , selector: @escaping ( Entry ) -> Target ? ) -> Self {
8+ public static func from< Entry: PlatformEntity > ( _ entryType: Entry . Type , selector: @MainActor @ Sendable @ escaping ( Entry ) -> Target ? ) -> Self {
99 . init(
1010 receiverSelector: { controller in
1111 controller. as ( Entry . Base. self) ? . receiver ( ofType: Entry . self) . flatMap ( selector)
@@ -16,32 +16,32 @@ public struct IntrospectionSelector<Target: PlatformEntity> {
1616 )
1717 }
1818
19- private var receiverSelector : ( IntrospectionPlatformViewController ) -> Target ?
20- private var ancestorSelector : ( IntrospectionPlatformViewController ) -> Target ?
19+ private var receiverSelector : @ MainActor @ Sendable ( IntrospectionPlatformViewController ) -> Target ?
20+ private var ancestorSelector : @ MainActor @ Sendable ( IntrospectionPlatformViewController ) -> Target ?
2121
2222 private init (
23- receiverSelector: @escaping ( IntrospectionPlatformViewController ) -> Target ? ,
24- ancestorSelector: @escaping ( IntrospectionPlatformViewController ) -> Target ?
23+ receiverSelector: @MainActor @ Sendable @ escaping ( IntrospectionPlatformViewController ) -> Target ? ,
24+ ancestorSelector: @MainActor @ Sendable @ escaping ( IntrospectionPlatformViewController ) -> Target ?
2525 ) {
2626 self . receiverSelector = receiverSelector
2727 self . ancestorSelector = ancestorSelector
2828 }
2929
3030 @_spi ( Advanced)
31- public func withReceiverSelector( _ selector: @escaping ( PlatformViewController ) -> Target ? ) -> Self {
31+ public func withReceiverSelector( _ selector: @MainActor @ Sendable @ escaping ( PlatformViewController ) -> Target ? ) -> Self {
3232 var copy = self
3333 copy. receiverSelector = selector
3434 return copy
3535 }
3636
3737 @_spi ( Advanced)
38- public func withAncestorSelector( _ selector: @escaping ( PlatformViewController ) -> Target ? ) -> Self {
38+ public func withAncestorSelector( _ selector: @MainActor @ Sendable @ escaping ( PlatformViewController ) -> Target ? ) -> Self {
3939 var copy = self
4040 copy. ancestorSelector = selector
4141 return copy
4242 }
4343
44- func callAsFunction( _ controller: IntrospectionPlatformViewController , _ scope: IntrospectionScope ) -> Target ? {
44+ @ MainActor func callAsFunction( _ controller: IntrospectionPlatformViewController , _ scope: IntrospectionScope ) -> Target ? {
4545 if
4646 scope. contains ( . receiver) ,
4747 let target = receiverSelector ( controller)
0 commit comments