Skip to content

Commit 4b7d623

Browse files
committed
Merge branch 'master' into ci/visionos
2 parents 8a3771e + 9da0f9b commit 4b7d623

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Changelog
33

44
## master
55

6+
## [0.11.1]
7+
8+
- Fixed: `@_spi` errors (#339)
9+
610
## [0.11.0]
711

812
- Added: visionOS support (#327)

Examples/Showcase/Showcase/App.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ struct App: SwiftUI.App {
2323
}
2424
}
2525
#endif
26+
27+
#if swift(>=5.9)
28+
#Preview {
29+
AppView()
30+
}
31+
#endif

Sources/Introspect.swift

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ public protocol PlatformEntity: AnyObject {
108108
func isDescendant(of other: Base) -> Bool
109109
}
110110

111+
extension PlatformEntity {
112+
@_spi(Internals)
113+
public var ancestor: Base? { nil }
114+
115+
@_spi(Internals)
116+
public var descendants: [Base] { [] }
117+
118+
@_spi(Internals)
119+
public func isDescendant(of other: Base) -> Bool { false }
120+
}
121+
111122
extension PlatformEntity {
112123
@_spi(Internals)
113124
public var ancestors: some Sequence<Base> {
@@ -196,24 +207,10 @@ extension PlatformViewController: PlatformEntity {
196207

197208
#if canImport(UIKit)
198209
extension UIPresentationController: PlatformEntity {
199-
@_spi(Internals)
200-
public var ancestor: UIPresentationController? { nil }
201-
202-
@_spi(Internals)
203-
public var descendants: [UIPresentationController] { [] }
204-
205-
@_spi(Internals)
206-
public func isDescendant(of other: UIPresentationController) -> Bool { false }
210+
public typealias Base = UIPresentationController
207211
}
208212
#elseif canImport(AppKit)
209213
extension NSWindow: PlatformEntity {
210-
@_spi(Internals)
211-
public var ancestor: NSWindow? { nil }
212-
213-
@_spi(Internals)
214-
public var descendants: [NSWindow] { [] }
215-
216-
@_spi(Internals)
217-
public func isDescendant(of other: NSWindow) -> Bool { false }
214+
public typealias Base = NSWindow
218215
}
219216
#endif

0 commit comments

Comments
 (0)