forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSection.swift
More file actions
35 lines (33 loc) · 843 Bytes
/
Section.swift
File metadata and controls
35 lines (33 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import SwiftUI
struct Section<Content: View>: View {
@ViewBuilder var content: () -> Content
var body: some View {
Group {
content()
}
.foregroundColor(.white)
.padding(.all, 12)
.background(
RoundedRectangle(cornerRadius: 8, style: .continuous)
.stroke(
Color.white.opacity(0.3),
style: .init(lineWidth: 1)
)
.background(.clear)
)
}
}
struct Section_Preview: PreviewProvider {
static var previews: some View {
Group {
Section {
VStack {
Text("Hello")
Text("World")
}
}
}
.padding(.all, 30)
.background(Color("BackgroundColor"))
}
}