Skip to content

Instantly share code, notes, and snippets.

@SwiftyAlex
Created April 7, 2020 18:40
Show Gist options
  • Save SwiftyAlex/fdd3309d00f36f32c3dc6cc95dc467f0 to your computer and use it in GitHub Desktop.
Save SwiftyAlex/fdd3309d00f36f32c3dc6cc95dc467f0 to your computer and use it in GitHub Desktop.
struct HomeView: View {
let featuredPodcasts: [Podcast]
let popularPodcasts: [Podcast]
let yourPodcasts: [Podcast]
var body: some View {
NavigationView {
VStack(alignment: .leading) {
Text("Welcome to SwiftUI")
.font(.subheadline)
.bold()
.padding()
ScrollView(.horizontal) {
HStack {
ForEach(featuredPodcasts, id: \.self) { _ in
RoundedRectangle(cornerRadius: 22, style: .continuous)
.foregroundColor(Color.blue)
.frame(width: 120, height: 120)
}
Spacer()
}
.padding()
}
ScrollView(.horizontal) {
HStack {
ForEach(popularPodcasts, id: \.self) { _ in
RoundedRectangle(cornerRadius: 22, style: .continuous)
.foregroundColor(Color.blue)
.frame(width: 120, height: 120)
}
Spacer()
}
.padding()
}
ScrollView(.horizontal) {
HStack {
ForEach(yourPodcasts, id: \.self) { _ in
RoundedRectangle(cornerRadius: 22, style: .continuous)
.foregroundColor(Color.blue)
.frame(width: 120, height: 120)
}
Spacer()
}
.padding()
}
Spacer()
}
.navigationBarTitle("Home")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment