You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ struct ContentView: View {
71
71
Then, to add basic support for a detail page, targeting both macOS and iOS, you'll need to:
72
72
73
73
* A. Import the `SwiftDetailer` and `SwiftDetailerMenu` packages.
74
-
* B. Add state properties, and a typealias for cleaner code.
74
+
* B. Add state property for element to edit, and a typealias for cleaner code.
75
75
* C. Give each row a menu (context for macOS; swipe for iOS).
76
76
* D. Add a call to `editDetailer`, available as a modifier.
77
77
* E. Include a `Form` containing the fields to edit, and ...
@@ -103,7 +103,6 @@ struct ContentView: View {
103
103
]
104
104
105
105
@Stateprivatevar toEdit: Fruit?=nil// B
106
-
@Stateprivatevar isAdd: Bool=false
107
106
108
107
typealiasContext= DetailerContext<Fruit>
109
108
@@ -119,7 +118,7 @@ struct ContentView: View {
119
118
}
120
119
.editDetailer(.init(onSave: saveAction),
121
120
toEdit: $toEdit,
122
-
isAdd: $isAdd,
121
+
originalID: toEdit?.id,
123
122
detailContent: editDetail) // D
124
123
}
125
124
@@ -155,7 +154,7 @@ struct ContentView: View {
155
154
156
155
On macOS, ctrl-click (or right-click) on a row to invoke the context menu. On iOS, swipe the row to invoke the menu.
157
156
158
-
For a full implementation, see the _DetailerDemo_ project (link below). It extends the example with operations to add new records, delete records, and validate input.
157
+
For a full implementation, with ability to add new records, see the _DetailerDemo_ project (link below). It extends the example with operations to add new records, delete records, and validate input.
159
158
160
159
It shows _Detailer_ used with `LazyVGrid` and `Table` containers.
0 commit comments