var body: some View {
List {
ForEach(0..<10) {_ in
VStack {
HStack {
Rectangle()
.frame(width: 50, height: 50)
.foregroundColor(.red)
VStack(alignment: .leading) {
Text("テキスト")
Text("テキスト")
.foregroundColor(.gray)
.font(.system(size: 12))
Text("テキスト")
.foregroundColor(.gray)
.font(.system(size: 8))
}
Spacer()
VStack {
Spacer()
HStack {
Button(action: {
}, label: {
Rectangle()
.frame(width: 15, height: 15)
.foregroundColor(.blue)
})
Button(action: {
}, label: {
Rectangle()
.frame(width: 15, height: 15)
.foregroundColor(.blue)
})
}
}
}
}
}
}
}
var body: some View {
List {
ForEach(0..<10) {_ in
VStack {
HStack {
image()
description()
Spacer()
buttonView()
}
}
}
}
}
private func image() -> some View {
return Rectangle()
.frame(width: 50, height: 50)
.foregroundColor(.red)
}
private func description() -> some View {
return VStack(alignment: .leading) {
Text("テキスト")
Text("テキスト")
.foregroundColor(.gray)
.font(.system(size: 12))
Text("テキスト")
.foregroundColor(.gray)
.font(.system(size: 8))
}
}
private func buttonView() -> some View {
return VStack {
Spacer()
HStack {
button {
}
button {
}
}
}
}
private func button(action: @escaping () -> Void) -> some View {
return Button(action: {
action()
}, label: {
Rectangle()
.frame(width: 15, height: 15)
.foregroundColor(.blue)
})
}
.
.
.
Rectangle()
.frame(width: 50, height: 50)
.foregroundColor(.red)
description()
.
.
.