I created a music player using swiftUI.I need to ask a question when I break up my player into usable components. How should I take this approach with the music player? because the music player is one view can't break up?
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image("albumCover")
HStack{
VStack {
Text("Album name")
Text("Artist name")
}
Spacer()
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "heart")
}
}.padding()
HStack{
Text("0")
Slider(value: /*@START_MENU_TOKEN@*//*@PLACEHOLDER=Value@*/.constant(10)/*@END_MENU_TOKEN@*/)
Text("-5:00")
}.padding()
HStack{
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "shuffle")
}
Spacer()
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName:"backward.end")
}
Spacer()
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "play")
}
Spacer()
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "forward.end")
}
Spacer()
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "repeat")
}
}.padding()
HStack{
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "hifispeaker")
}
Spacer()
Button(action: /*@START_MENU_TOKEN@*/{}/*@END_MENU_TOKEN@*/) {
Image(systemName: "music.note.list")
}
}.padding()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}