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 {
associatedtype Base: PlatformEntity
@_spi(Internals)
var isIntrospectionEntity: Bool { get }
@_spi(Internals)
var ancestor: Base? { get }
@ -140,27 +137,12 @@ extension PlatformEntity {
) -> PlatformSpecificEntity? {
self.ancestors
.lazy
.filter { !$0.isIntrospectionEntity }
.compactMap { $0 as? PlatformSpecificEntity }
.first
}
}
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)
public var ancestor: PlatformView? {
superview
@ -178,12 +160,6 @@ extension PlatformView: PlatformEntity {
}
extension PlatformViewController: PlatformEntity {
@_spi(Internals)
public var isIntrospectionEntity: Bool {
return self is IntrospectionAnchorPlatformViewController
|| self is IntrospectionPlatformViewController
}
@_spi(Internals)
public var ancestor: PlatformViewController? {
parent