We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fc68e5 commit c437f1dCopy full SHA for c437f1d
Shared/Supporting Files/Views/FavoritesView.swift
@@ -16,7 +16,7 @@ import SwiftUI
16
17
struct FavoritesView: View {
18
/// The editing mode of the environment.
19
- @State private var editMode: EditMode = .inactive
+ @Environment(\.editMode) private var editMode
20
21
/// A Boolean value indicating whether the add favorite sheet is showing.
22
@State private var addFavoriteSheetIsShowing = false
@@ -57,9 +57,8 @@ struct FavoritesView: View {
57
}
58
59
60
- .environment(\.editMode, $editMode)
61
.onDisappear {
62
- editMode = .inactive
+ editMode?.wrappedValue = .inactive
63
64
65
0 commit comments