Skip to content

Commit a6f8b48

Browse files
committed
WIP
1 parent cc0f861 commit a6f8b48

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Sources/ViewTypes/NavigationSplitView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import SwiftUI
3030
/// } detail: {
3131
/// Text("Detail")
3232
/// }
33-
/// .introspect(.navigationSplitView, on: .tvOS(.v16, .v17, .v18)) {
33+
/// .introspect(.navigationSplitView, on: .tvOS(.v16, .v17)) {
3434
/// print(type(of: $0)) // UINavigationController
3535
/// }
3636
/// }
@@ -104,7 +104,8 @@ extension tvOSViewVersion<NavigationSplitViewType, UINavigationController> {
104104

105105
public static let v16 = Self(for: .v16, selector: selector)
106106
public static let v17 = Self(for: .v17, selector: selector)
107-
public static let v18 = Self(for: .v18, selector: selector)
107+
@available(*, unavailable, message: "NavigationSplitView isn't backed by UIKit since tvOS 18")
108+
public static let v18 = Self.unavailable()
108109

109110
private static var selector: IntrospectionSelector<UINavigationController> {
110111
.default.withAncestorSelector { $0.navigationController }

Tests/Tests/ViewTypes/NavigationSplitViewTests.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ final class NavigationSplitViewTests: XCTestCase {
1717
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
1818
throw XCTSkip()
1919
}
20+
guard #unavailable(tvOS 18) else {
21+
throw XCTSkip()
22+
}
2023

2124
XCTAssertViewIntrospection(of: PlatformNavigationSplitView.self) { spies in
2225
let spy = spies[0]
@@ -35,7 +38,7 @@ final class NavigationSplitViewTests: XCTestCase {
3538
#if os(iOS) || os(visionOS)
3639
.introspect(.navigationSplitView, on: .iOS(.v16, .v17, .v18), .visionOS(.v1), customize: spy)
3740
#elseif os(tvOS)
38-
.introspect(.navigationSplitView, on: .tvOS(.v16, .v17, .v18), customize: spy)
41+
.introspect(.navigationSplitView, on: .tvOS(.v16, .v17), customize: spy)
3942
#elseif os(macOS)
4043
.introspect(.navigationSplitView, on: .macOS(.v13, .v14), customize: spy)
4144
#endif
@@ -46,6 +49,9 @@ final class NavigationSplitViewTests: XCTestCase {
4649
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
4750
throw XCTSkip()
4851
}
52+
guard #unavailable(tvOS 18) else {
53+
throw XCTSkip()
54+
}
4955

5056
XCTAssertViewIntrospection(of: PlatformNavigationSplitView.self) { spies in
5157
let spy = spies[0]
@@ -58,7 +64,7 @@ final class NavigationSplitViewTests: XCTestCase {
5864
#if os(iOS) || os(visionOS)
5965
.introspect(.navigationSplitView, on: .iOS(.v16, .v17, .v18), .visionOS(.v1), scope: .ancestor, customize: spy)
6066
#elseif os(tvOS)
61-
.introspect(.navigationSplitView, on: .tvOS(.v16, .v17, .v18), scope: .ancestor, customize: spy)
67+
.introspect(.navigationSplitView, on: .tvOS(.v16, .v17), scope: .ancestor, customize: spy)
6268
#elseif os(macOS)
6369
.introspect(.navigationSplitView, on: .macOS(.v13, .v14), scope: .ancestor, customize: spy)
6470
#endif

0 commit comments

Comments
 (0)