@@ -7,9 +7,14 @@ public struct IntrospectionSelector<Target: PlatformEntity> {
7
7
public static var `default` : Self { . from( Target . self, selector: { $0 } ) }
8
8
9
9
@_spi ( Internals)
10
- public func withAncestorSelector(
11
- _ selector: @escaping ( PlatformViewController ) -> Target ?
12
- ) -> Self {
10
+ public func withReceiverSelector( _ selector: @escaping ( PlatformViewController , IntrospectionAnchorID ) -> Target ? ) -> Self {
11
+ var copy = self
12
+ copy. receiverSelector = selector
13
+ return copy
14
+ }
15
+
16
+ @_spi ( Internals)
17
+ public func withAncestorSelector( _ selector: @escaping ( PlatformViewController ) -> Target ? ) -> Self {
13
18
var copy = self
14
19
copy. ancestorSelector = selector
15
20
return copy
@@ -18,21 +23,21 @@ public struct IntrospectionSelector<Target: PlatformEntity> {
18
23
@_spi ( Internals)
19
24
public static func from< Entry: PlatformEntity > ( _ entryType: Entry . Type , selector: @escaping ( Entry ) -> Target ? ) -> Self {
20
25
. init(
21
- receiver : { controller, anchorID in
26
+ receiverSelector : { controller, anchorID in
22
27
controller. as ( Entry . self) ? . receiver ( ofType: Entry . self, anchorID: anchorID) . flatMap ( selector)
23
28
} ,
24
- ancestor : { controller in
29
+ ancestorSelector : { controller in
25
30
controller. as ( Entry . self) ? . ancestor ( ofType: Entry . self) . flatMap ( selector)
26
31
}
27
32
)
28
33
}
29
34
30
35
init (
31
- receiver : @escaping ( IntrospectionPlatformViewController , IntrospectionAnchorID ) -> Target ? ,
32
- ancestor : @escaping ( IntrospectionPlatformViewController ) -> Target ?
36
+ receiverSelector : @escaping ( IntrospectionPlatformViewController , IntrospectionAnchorID ) -> Target ? ,
37
+ ancestorSelector : @escaping ( IntrospectionPlatformViewController ) -> Target ?
33
38
) {
34
- self . receiverSelector = receiver
35
- self . ancestorSelector = ancestor
39
+ self . receiverSelector = receiverSelector
40
+ self . ancestorSelector = ancestorSelector
36
41
}
37
42
38
43
func callAsFunction(
0 commit comments