This commit is contained in:
David Roman 2023-06-02 23:29:51 +01:00
parent 505604911c
commit a767ddfb75
No known key found for this signature in database
GPG Key ID: 7058646EEFCB70A7
1 changed files with 0 additions and 24 deletions

View File

@ -58,9 +58,6 @@ extension View {
public protocol PlatformEntity: AnyObject { public protocol PlatformEntity: AnyObject {
associatedtype Base: PlatformEntity associatedtype Base: PlatformEntity
@_spi(Internals)
var isIntrospectionEntity: Bool { get }
@_spi(Internals) @_spi(Internals)
var ancestor: Base? { get } var ancestor: Base? { get }
@ -140,27 +137,12 @@ extension PlatformEntity {
) -> PlatformSpecificEntity? { ) -> PlatformSpecificEntity? {
self.ancestors self.ancestors
.lazy .lazy
.filter { !$0.isIntrospectionEntity }
.compactMap { $0 as? PlatformSpecificEntity } .compactMap { $0 as? PlatformSpecificEntity }
.first .first
} }
} }
extension PlatformView: PlatformEntity { extension PlatformView: PlatformEntity {
@_spi(Internals)
public var isIntrospectionEntity: Bool {
#if canImport(UIKit)
if let next = self.next as? PlatformViewController {
return next.isIntrospectionEntity
}
#elseif canImport(AppKit)
if let next = self.nextResponder as? PlatformViewController {
return next.isIntrospectionEntity
}
#endif
return false
}
@_spi(Internals) @_spi(Internals)
public var ancestor: PlatformView? { public var ancestor: PlatformView? {
superview superview
@ -178,12 +160,6 @@ extension PlatformView: PlatformEntity {
} }
extension PlatformViewController: PlatformEntity { extension PlatformViewController: PlatformEntity {
@_spi(Internals)
public var isIntrospectionEntity: Bool {
return self is IntrospectionAnchorPlatformViewController
|| self is IntrospectionPlatformViewController
}
@_spi(Internals) @_spi(Internals)
public var ancestor: PlatformViewController? { public var ancestor: PlatformViewController? {
parent parent