---
title: "init(_:editActions:rowContent:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/list/init(_:editactions:rowcontent:)"
---

# init(_:editActions:rowContent:)

Creates a list that computes its rows on demand from an underlying collection of identifiable data and enables editing the collection.

## Declaration

```swift
nonisolated init<Data, RowContent>(_ data: Binding<Data>, editActions: EditActions<Data>, @ContentBuilder rowContent: @escaping (Binding<Data.Element>) -> RowContent) where Content == ForEach<IndexedIdentifierCollection<Data, Data.Element.ID>, Data.Element.ID, EditableCollectionContent<RowContent, Data>>, Data : MutableCollection, Data : RandomAccessCollection, RowContent : View, Data.Element : Identifiable, Data.Index : Hashable
```

## Parameters

- `data`: A collection of identifiable data for computing the list.
- `editActions`: The edit actions that are synthesized on data.
- `rowContent`: A content builder that creates the view for a single row of the list.

## Discussion

Discussion The following example creates a list to display a collection of favorite foods allowing the user to delete or move elements from the collection. List($foods, editActions: [.delete, .move]) { $food in    HStack {        Text(food.name)        Toggle("Favorite", isOn: $food.isFavorite)    } } Use deleteDisabled(_:) and moveDisabled(_:) to disable respectively delete or move actions on a per-row basis. Explicit DynamicViewContent.onDelete(perform:), DynamicViewContent.onMove(perform:), or View.swipeActions(edge:allowsFullSwipe:content:) modifiers will override any synthesized action

## See Also

### Creating a list from editable data

- [init(_:editActions:selection:rowContent:)](swiftui/list/init(_:editactions:selection:rowcontent:).md)
- [init(_:id:editActions:rowContent:)](swiftui/list/init(_:id:editactions:rowcontent:).md)
- [init(_:id:editActions:selection:rowContent:)](swiftui/list/init(_:id:editactions:selection:rowcontent:).md)
