Skip to content

Commit c966d5d

Browse files
committed
Update error alert.
1 parent 53af116 commit c966d5d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Shared/Samples/Find address with reverse geocode/FindAddressWithReverseGeocodeView.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,8 @@ struct FindAddressWithReverseGeocodeView: View {
2828
/// The text shown in the callout.
2929
@State private var calloutText: String?
3030

31-
/// A Boolean value indicating whether the error alert is showing.
32-
@State private var errorAlertIsShowing = false
33-
3431
/// The error shown in the error alert.
35-
@State private var error: Error? {
36-
didSet { errorAlertIsShowing = error != nil }
37-
}
32+
@State private var error: Error?
3833

3934
var body: some View {
4035
MapView(map: model.map, graphicsOverlays: [model.graphicsOverlay])
@@ -63,7 +58,7 @@ struct FindAddressWithReverseGeocodeView: View {
6358
.padding(8)
6459
.background(.thinMaterial, ignoresSafeAreaEdges: .horizontal)
6560
}
66-
.alert(isPresented: $errorAlertIsShowing, presentingError: error)
61+
.errorAlert(presentingError: $error)
6762
}
6863

6964
/// Reverse geocodes a given point and updates the marker with the result.

0 commit comments

Comments
 (0)