Skip to content

Instantly share code, notes, and snippets.

@prafullakumar
Created April 27, 2021 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prafullakumar/c3c05954953e2a7204ab04564613577d to your computer and use it in GitHub Desktop.
Save prafullakumar/c3c05954953e2a7204ab04564613577d to your computer and use it in GitHub Desktop.
struct ContentView: View {
var body: some View {
NavigationView {
ScrollView {
LazyVStack.init(spacing: 0, pinnedViews: [.sectionHeaders], content: {
Section.init(header:
HStack {
Text("Section 1")
Spacer()
}.padding()
.background(Color.blue))
{
ForEach(1...10, id: \.self) { count in
ContentCell(data: "cell \(count)")
}
}
})
}.navigationTitle("Demo")
}
}
}
struct ContentCell: View {
let data: String
var body: some View {
VStack {
HStack {
Text(data)
Spacer()
}.padding()
Divider()
.padding(.leading)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment