Xcode (13.3.1)
はじめに
今日はSwiftUIの勉強していきます。
リストなどでスワイプメニューを表示して項目を削除するレシピ記事になります。
参考にした書籍
その1 (Textのみ)
SomeView() .swipeActions(edge:.leading, allowsFullSwipe: false) { Button(role: .destructive) { // ここに削除ボタンされた時の処理を書きます } label: { Text("削除") } }
その2 (Imageのみ)
SomeView() .swipeActions(edge:.leading, allowsFullSwipe: false) { Button(role: .destructive) { // ここに削除ボタンされた時の処理を書きます } label: { Image(systemName: "trash") } }
おわりに
最後まで見ていただきヘペトナス!
読者登録・Twitterのフォローもお願いします。