Skip to content

Commit 13af9f3

Browse files
CalebRasyo1995
andauthored
Apply suggestions from code review.
Co-authored-by: Ting <[email protected]>
1 parent 60c4daa commit 13af9f3

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Shared/Samples/Edit features using feature forms/EditFeaturesUsingFeatureFormsView.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ import SwiftUI
1818

1919
struct EditFeaturesUsingFeatureFormsView: View {
2020
/// The map that contains the features for editing.
21-
@State private var map: Map = {
22-
// Creates the map from the "Feature Form Places" web map portal item.
23-
let portalItem = PortalItem(
21+
@State private var map = Map(
22+
item: PortalItem(
2423
portal: .arcGISOnline(connection: .anonymous),
2524
id: .featureFormPlacesWebMap
2625
)
27-
return Map(item: portalItem)
28-
}()
26+
)
2927

3028
/// The feature form for the selected feature.
3129
@State private var featureForm: FeatureForm?
@@ -119,10 +117,8 @@ struct EditFeaturesUsingFeatureFormsView: View {
119117
}
120118
.alert("Discard Edits", isPresented: $isShowingDiscardEditsAlert) {
121119
Button("Cancel", role: .cancel) {
122-
isShowingDiscardEditsAlert = false
123120
}
124121
Button("Discard", role: .destructive) {
125-
isShowingDiscardEditsAlert = false
126122
featureForm?.discardEdits()
127123
endEditing()
128124
}

Shared/Samples/Edit features using feature forms/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Tap a feature on the map to open a sheet displaying the feature form. Select for
2424
7. To commit edits on the service geodatabase:
2525
1. Call `featureForm.finishEditing()` to save edits to the database.
2626
2. Retrieve the backing service feature table's geodatabase using `serviceFeatureTable.serviceGeodatabase`.
27-
3. Verify the service geodatabase can commit changes back to the service using `serviceGeodatabase.serviceInfo.canUseServiceGeodatabaseApplyEdits`
27+
3. Verify the service geodatabase can commit changes back to the service using `serviceGeodatabase.serviceInfo.canUseServiceGeodatabaseApplyEdits`.
2828
4. If apply edits are allowed, call `serviceGeodatabase.applyEdits()` to apply local edits to the online service.
29-
5. If edits are not allowed on the `ServiceGeodatabase`, then apply edits to the `ServiceFeatureTable` using `ServiceFeatureTable.applyEdits()`
29+
5. If edits are not allowed on the `ServiceGeodatabase`, then apply edits to the `ServiceFeatureTable` using `ServiceFeatureTable.applyEdits()`.
3030

3131
## Relevant API
3232

@@ -44,7 +44,7 @@ This sample uses a feature forms enabled [Feature Form Places web map](https://w
4444

4545
## Additional information
4646

47-
Follow the [tutorial](https://doc.arcgis.com/en/arcgis-online/create-maps/create-form-mv.htm) to create your own form using the Map Viewer. This sample uses the Feature Form Toolkit component. For information about setting up the toolkit, as well as code for the underlying component, visit [ArcGIS Maps SDK for Swift Toolkit](https://github.com/ArcGIS/arcgis-maps-sdk-swift-toolkit).
47+
Follow the [tutorial](https://doc.arcgis.com/en/arcgis-online/create-maps/create-form-mv.htm) to create your own form using the Map Viewer. This sample uses the Feature Form Toolkit component. For information about setting up the toolkit, as well as code for the underlying component, visit [ArcGIS Maps SDK for Swift Toolkit](https://github.com/Esri/arcgis-maps-sdk-swift-toolkit).
4848

4949
## Tags
5050

0 commit comments

Comments
 (0)