👌
【SwiftUI】『swipeActions』で「弾ける曲」「練習中の曲」「弾きたい曲」に分割する
import SwiftUI
struct ContentView: View {
var body: some View {
List {
Text("HANABI")
.swipeActions(edge: .trailing, allowsFullSwipe: false) {
Button {
print()
} label: {
Text("弾ける曲")
}
.tint(.red)
Button {
print()
} label: {
Text("練習中の曲")
}
.tint(.orange)
Button {
print()
} label: {
Text("弾きたい曲")
}
.tint(.yellow)
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Discussion