👌

【SwiftUI】『swipeActions』で「弾ける曲」「練習中の曲」「弾きたい曲」に分割する

2023/06/27に公開

スクリーンショット 2023-06-27 16.03.34.png

スクリーンショット 2023-06-27 16.03.40.png

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