File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ public struct ConstructView<T>: View {
2323
2424#Preview {
2525 ConstructView ( for: 42 )
26+ . construct {
27+ ConstructItem . missing { missing in
28+ Text ( " Missing \( missing. type) " )
29+ }
30+ ConstructItem ( for: Int . self) { value in
31+ Text ( " Value \( value) " )
32+ }
33+ }
2634}
2735
2836#Preview {
Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ public struct ConstructItem: ConstructContent {
1414}
1515
1616public extension ConstructItem {
17- init < T> ( for type : T . Type , @ViewBuilder block: @escaping ( T ) -> some View ) {
18- self . init ( symbol: Symbol ( type ) , block: Block ( block) )
17+ init < T> ( for symbol : T . Type , @ViewBuilder block: @escaping ( _ symbol : T ) -> some View ) {
18+ self . init ( symbol: Symbol ( symbol ) , block: Block ( block) )
1919 }
2020
21- init ( for type : ( some Any ) . Type, @ViewBuilder block: @escaping ( ) -> some View ) {
22- self . init ( for: type ) { _ in block ( ) }
21+ init ( for symbol : ( some Any ) . Type, @ViewBuilder block: @escaping ( ) -> some View ) {
22+ self . init ( for: symbol ) { _ in block ( ) }
2323 }
2424
25- static func missing< T > ( _ type : T . Type , @ViewBuilder block: @escaping ( T ) -> some View ) -> Self {
26- Self ( for: type , block: block)
25+ static func missing( @ViewBuilder block: @escaping ( _ missing : MissingSymbol ) -> some View ) -> Self {
26+ Self ( for: MissingSymbol . self , block: block)
2727 }
2828
29- static func missing( _ type : ( some Any ) . Type , @ViewBuilder block: @escaping ( ) -> some View ) -> Self {
30- . missing( type ) { _ in block ( ) }
29+ static func missing( @ViewBuilder block: @escaping ( ) -> some View ) -> Self {
30+ . missing { _ in block ( ) }
3131 }
3232}
You can’t perform that action at this time.
0 commit comments