@@ -25,7 +25,7 @@ import AdvancedList
25
25
26
26
AdvancedList (yourData, content : { item in
27
27
Text (" Item" )
28
- }, listState : $ listState, emptyStateView : {
28
+ }, listState : listState, emptyStateView : {
29
29
Text (" No data" )
30
30
}, errorStateView : { error in
31
31
Text (error.localizedDescription )
@@ -53,7 +53,7 @@ AdvancedList(yourData, listView: { rows in
53
53
}
54
54
}, content : { item in
55
55
Text (" Item" )
56
- }, listState : $ listState, emptyStateView : {
56
+ }, listState : listState, emptyStateView : {
57
57
Text (" No data" )
58
58
}, errorStateView : { error in
59
59
Text (error.localizedDescription )
@@ -112,7 +112,7 @@ import AdvancedList
112
112
113
113
AdvancedList (yourData, content : { item in
114
114
Text (" Item" )
115
- }, listState : $ listState, emptyStateView : {
115
+ }, listState : listState, emptyStateView : {
116
116
Text (" No data" )
117
117
}, errorStateView : { error in
118
118
Text (error.localizedDescription )
@@ -143,7 +143,7 @@ import AdvancedList
143
143
144
144
AdvancedList (yourData, content : { item in
145
145
Text (" Item" )
146
- }, listState : $ listState, emptyStateView : {
146
+ }, listState : listState, emptyStateView : {
147
147
Text (" No data" )
148
148
}, errorStateView : { error in
149
149
VStack {
@@ -417,3 +417,63 @@ AdvancedList(yourData, content: { item in
417
417
})
418
418
```
419
419
</details >
420
+
421
+ <details >
422
+ <summary >Migration 6.0 -> 7.0</summary >
423
+
424
+ I replaced the unnecessary listState ` Binding ` and replaced it with a simple value parameter.
425
+
426
+ ** Before:**
427
+
428
+ ``` swift
429
+ import AdvancedList
430
+
431
+ @State private var listState: ListState = .items
432
+
433
+ AdvancedList (yourData, content : { item in
434
+ Text (" Item" )
435
+ }, listState : $listState, emptyStateView : {
436
+ Text (" No data" )
437
+ }, errorStateView : { error in
438
+ VStack {
439
+ Text (error.localizedDescription )
440
+ .lineLimit (nil )
441
+
442
+ Button (action : {
443
+ // do something
444
+ }) {
445
+ Text (" Retry" )
446
+ }
447
+ }
448
+ }, loadingStateView : {
449
+ Text (" Loading ..." )
450
+ }, pagination : .noPagination )
451
+ ```
452
+
453
+ ** After:**
454
+
455
+ ``` swift
456
+ import AdvancedList
457
+
458
+ @State private var listState: ListState = .items
459
+
460
+ AdvancedList (yourData, content : { item in
461
+ Text (" Item" )
462
+ }, listState : listState, emptyStateView : {
463
+ Text (" No data" )
464
+ }, errorStateView : { error in
465
+ VStack {
466
+ Text (error.localizedDescription )
467
+ .lineLimit (nil )
468
+
469
+ Button (action : {
470
+ // do something
471
+ }) {
472
+ Text (" Retry" )
473
+ }
474
+ }
475
+ }, loadingStateView : {
476
+ Text (" Loading ..." )
477
+ }, pagination : .noPagination )
478
+ ```
479
+ </details >
0 commit comments