File tree 2 files changed +46
-11
lines changed
Sources/OpenSwiftUICore/View
2 files changed +46
-11
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 @@ -87,16 +87,6 @@ public protocol View {
87
87
var body : Self . Body { get }
88
88
}
89
89
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
-
100
90
// MARK: - PrimitiveView
101
91
102
92
package protocol PrimitiveView : View { }
@@ -141,7 +131,30 @@ extension MultiView {
141
131
}
142
132
}
143
133
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 { }
145
158
146
159
// MARK: - ViewVisitor
147
160
You can’t perform that action at this time.
0 commit comments