Skip to content

Instantly share code, notes, and snippets.

@ryangittings
Last active September 18, 2019 14:08
Show Gist options
  • Save ryangittings/badd0d2e312bae064db06aea7c222048 to your computer and use it in GitHub Desktop.
Save ryangittings/badd0d2e312bae064db06aea7c222048 to your computer and use it in GitHub Desktop.
struct ContentView: View {
var body: some View {
List {
PosterView()
Section(header: Text("Section")) {
TestView()
}
Section(header: Text("Section")) {
TestView()
}
Section(header: Text("Section")) {
TestView()
}
Section(header: Text("Section")) {
ForEach(1...20, id: \.self) {_ in
Text("test")
}
}
}
.edgesIgnoringSafeArea(.top)
.listStyle(GroupedListStyle())
}
}
struct PosterView: View {
var body: some View {
Image(systemName: "tv.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 600)
}
}
struct TestView: View {
var body: some View {
ScrollView(.horizontal) {
HStack {
ForEach(1...20, id: \.self) {_ in
Image(systemName: "tv.fill")
.frame(width: 160, height: 240)
}
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment