struct MainView: View {
@State private var users = [“ZERIN”, “ARIF”, “TIKLU”]
var body: some View {
NavigationView {
List {
ForEach(users, id: \.self) {
user in Text(user)
}
.onDelete(perform: delete)
}
}
}
func delete(at offsets: IndexSet) { users.remove(atOffsets: offsets) }
}
There are 0 comments