File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #if canImport(AndroidSwiftUI)
2+ import AndroidSwiftUI
3+ #else
4+ import SwiftUI
5+ #endif
6+
7+ /// Type-erased catalog screen (a small AnyView shim usable as a navigation
8+ /// destination while keeping the entry list homogeneous).
9+ struct AnyCatalogScreen : View {
10+ private let content : AnyView
11+ init < V: View > ( _ view: V ) { self . content = AnyView ( view) }
12+ var body : some View { content }
13+ }
14+
15+ /// A titled example row shared by the playgrounds.
16+ struct Example < Content: View > : View {
17+ let title : String
18+ let content : Content
19+ init ( _ title: String , @ViewBuilder content: ( ) -> Content ) {
20+ self . title = title
21+ self . content = content ( )
22+ }
23+ var body : some View {
24+ VStack ( alignment: . leading, spacing: 8 ) {
25+ Text ( title)
26+ content
27+ Divider ( )
28+ }
29+ . padding ( )
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments