Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save archieedwards/ef779844ad4a36546efdaf159efb40ba to your computer and use it in GitHub Desktop.
Save archieedwards/ef779844ad4a36546efdaf159efb40ba to your computer and use it in GitHub Desktop.
a view to simulate common sub category views..
struct MediaContentView: View {
var colours : [Color] = [.red, .orange, .green, .pink, .purple, .yellow]
var body: some View {
ScrollView(.vertical, showsIndicators: true){
ForEach(0..<10) {_ in
HStack{
Rectangle()
.frame(width: UIScreen.main.bounds.size.width/6 , height: UIScreen.main.bounds.size.height/12)
.foregroundColor(self.colours[Int.random(in: 0 ... 5 )])
VStack(alignment: .leading){
Text("Insert Media").font(.headline).fixedSize(horizontal: true, vertical: false)
Text("by Spotify").font(.footnote).bold().foregroundColor(.secondary).fixedSize(horizontal: true, vertical: false)
}
Spacer()
}
}
}.padding(.leading)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment