Created
April 27, 2021 11:21
-
-
Save prafullakumar/c3c05954953e2a7204ab04564613577d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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