45 lines
1.6 KiB
Swift
45 lines
1.6 KiB
Swift
import SwiftUI
|
|
|
|
// MARK: SwiftUI.NavigationView { ... }.navigationViewStyle(.columns)
|
|
|
|
public struct NavigationViewWithColumnsStyleType: IntrospectableViewType {
|
|
public enum Style {
|
|
case columns
|
|
}
|
|
}
|
|
|
|
extension IntrospectableViewType where Self == NavigationViewWithColumnsStyleType {
|
|
public static func navigationView(style: Self.Style) -> Self { .init() }
|
|
}
|
|
|
|
#if canImport(UIKit)
|
|
extension iOSViewVersion<NavigationViewWithColumnsStyleType, UISplitViewController> {
|
|
public static let v13 = Self(for: .v13, selector: selector)
|
|
public static let v14 = Self(for: .v14, selector: selector)
|
|
public static let v15 = Self(for: .v15, selector: selector)
|
|
public static let v16 = Self(for: .v16, selector: selector)
|
|
|
|
private static var selector: IntrospectionSelector<UISplitViewController> {
|
|
.default.withAncestorSelector(\.splitViewController)
|
|
}
|
|
}
|
|
|
|
extension tvOSViewVersion<NavigationViewWithColumnsStyleType, UINavigationController> {
|
|
public static let v13 = Self(for: .v13, selector: selector)
|
|
public static let v14 = Self(for: .v14, selector: selector)
|
|
public static let v15 = Self(for: .v15, selector: selector)
|
|
public static let v16 = Self(for: .v16, selector: selector)
|
|
|
|
private static var selector: IntrospectionSelector<UINavigationController> {
|
|
.default.withAncestorSelector(\.navigationController)
|
|
}
|
|
}
|
|
#elseif canImport(AppKit)
|
|
extension macOSViewVersion<NavigationViewWithColumnsStyleType, NSSplitView> {
|
|
public static let v10_15 = Self(for: .v10_15)
|
|
public static let v11 = Self(for: .v11)
|
|
public static let v12 = Self(for: .v12)
|
|
public static let v13 = Self(for: .v13)
|
|
}
|
|
#endif
|