ContentView.swift
// // ContentView.swift // swiftuidev // // Created by Cairocoders // import SwiftUI struct ContentView: View { @State private var recipes = ["Bistek Tagalog", "Sinigang Na Baboy", "Ginisang Munggo", "Pork Estofado", "Pata Tim"] var body: some View { NavigationView { List { ForEach(recipes, id: \.self) { recipe in Text(recipe) } .onDelete(perform: self.deleteRow) } .navigationBarTitle(Text("Recipes")) } } private func deleteRow(at indexSet: IndexSet) { self.recipes.remove(atOffsets: indexSet) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }