File tree Expand file tree Collapse file tree 2 files changed +47
-12
lines changed
Sources/OpenSwiftUICore/View Expand file tree Collapse file tree 2 files changed +47
-12
lines changed Original file line number Diff line number Diff line change 1+ //
2+ // Never+View.swift
3+ // OpenSwiftUICore
4+ //
5+ // Audited for iOS 18.0
6+ // Status: Complete
7+
8+ // MARK: - Never + View
9+
10+ #if canImport(CoreTransferable)
11+ import CoreTransferable
12+ #endif
13+
14+ extension Never : View {
15+ #if !canImport(CoreTransferable)
16+ public var body : Never { self }
17+ #endif
18+
19+ nonisolated public static func _viewListCount( inputs _: _ViewListCountInputs ) -> Int ? {
20+ nil
21+ }
22+ }
Original file line number Diff line number Diff line change 33// OpenSwiftUICore
44//
55// Audited for iOS 18.0
6- // Status: WIP
6+ // Status: Complete
77// ID: 1ABF77B82C037C602A176AE349787FED (SwiftUICore)
88
99import OpenSwiftUI_SPI
@@ -87,16 +87,6 @@ public protocol View {
8787 var body : Self . Body { get }
8888}
8989
90- // MARK: - Never + View
91-
92- extension Never : View {
93- public var body : Never { self }
94-
95- nonisolated public static func _viewListCount( inputs _: _ViewListCountInputs ) -> Int ? {
96- nil
97- }
98- }
99-
10090// MARK: - PrimitiveView
10191
10292package protocol PrimitiveView : View { }
@@ -141,7 +131,30 @@ extension MultiView {
141131 }
142132}
143133
144- // TODO: _UnaryViewAdaptor
134+ // MARK: - _UnaryViewAdaptor
135+
136+ /// Shim to turn a view that may implement _makeViewList() into a
137+ /// single view.
138+ @frozen
139+ public struct _UnaryViewAdaptor < Content> : View , UnaryView , PrimitiveView where Content : View {
140+ public var content : Content
141+
142+ @inlinable
143+ public init ( _ content: Content ) {
144+ self . content = content
145+ }
146+
147+ package init ( @ViewBuilder content: ( ) -> Content ) {
148+ self . content = content ( )
149+ }
150+
151+ nonisolated public static func _makeView( view: _GraphValue < Self > , inputs: _ViewInputs ) -> _ViewOutputs {
152+ Content . makeDebuggableView ( view: view [ offset: { . of( & $0. content) } ] , inputs: inputs)
153+ }
154+ }
155+
156+ @available ( * , unavailable)
157+ extension _UnaryViewAdaptor : Sendable { }
145158
146159// MARK: - ViewVisitor
147160
You can’t perform that action at this time.
0 commit comments