Skip to content

Commit ca4dbb0

Browse files
author
Christian Elies
committed
docs(readme): moved migration information into expandable sections
1 parent 03c5b1d commit ca4dbb0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ AdvancedList(yourData, content: { item in
148148

149149
For more examples take a look at [AdvancedList-SwiftUI](https://github.com/crelies/AdvancedList-SwiftUI).
150150

151-
## Migration 2.x -> 3.0
151+
## Migration
152152

153+
<details>
154+
<summary>Migration 2.x -> 3.0</summary>
153155
The `AdvancedList` was dramatically simplified and is now more like the `List` and `ForEach` SwiftUI views.
154156

155157
1. Delete your list service instances and directly **pass your data to the list initializer**
@@ -158,6 +160,7 @@ The `AdvancedList` was dramatically simplified and is now more like the `List` a
158160
4. **Move and delete:** Instead of setting `AdvancedListActions` on your list service just pass a `onMoveAction` and/or `onDeleteAction` block to the initializer
159161

160162
**Before:**
163+
161164
```swift
162165
import AdvancedList
163166

@@ -193,6 +196,7 @@ listService.listState = .items
193196
```
194197

195198
**After:**
199+
196200
```swift
197201
import AdvancedList
198202

@@ -221,12 +225,14 @@ AdvancedList(yourData, content: { item in
221225
Text("Loading ...")
222226
}, pagination: .noPagination)
223227
```
228+
</details>
224229

225-
## Migration 3.0 -> 4.0
226-
230+
<details>
231+
<summary>Migration 3.0 -> 4.0</summary>
227232
Thanks to a hint from @SpectralDragon I could refactor the `onMove` and `onDelete` functionality to view modifiers.
228233

229234
**Before:**
235+
230236
```swift
231237
import AdvancedList
232238

@@ -257,6 +263,7 @@ AdvancedList(yourData, content: { item in
257263
```
258264

259265
**After:**
266+
260267
```swift
261268
import AdvancedList
262269

@@ -287,3 +294,4 @@ AdvancedList(yourData, content: { item in
287294
// delete me
288295
}
289296
```
297+
</details>

0 commit comments

Comments
 (0)