Created
April 7, 2020 18:40
-
-
Save SwiftyAlex/fdd3309d00f36f32c3dc6cc95dc467f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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