When I Press the save button the popover does not close
Code
.popover(isPresented: $showingPopover) {
NavigationView {
ModifyRecipeView(recipe: $recipe)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button("Save") {
showingPopover = false
}
}
}
.navigationTitle("Edit Recipe")
}
.onDisappear {
recipeData.saveRecipes()
}
}
Post
Replies
Boosts
Views
Activity
[QuestionView(question:viewModel.currentQuestion)
Errors
Cannot convert value of type 'Binding' to expected argument type 'Question'
Referencing subscript 'subscript(dynamicMember:)' requires wrapper 'ObservedObject.Wrapper'
Value of type 'GameViewModel' has no dynamic member 'currentQuestion' using key path from root type 'GameViewModel'
Insert '$'
struct Code_HistoryApp: App {
var body: some Scene {
WindowGroup {
WelcomeView() <--Error Here
}
}
}
I Am Having This Issue Xcode 13
Thread 1: EXC_BAD_ACCESS (code=1, address=0x88021d4488101ff8) Error
Already Fixed
i get the expected expression error every time i restart Xcode i have tried numerous times to fix it here is the code
import SwiftUI
struct MainView: View {
var body: some View {
Color(.secondarySystemBackground)
HStack{
}
NavigationView{
Text("")
.navigationTitle("Home")
}
navigationBarItems(trailing:
Button(action: {
print("Hello")
}) {
Image(systemName: "square.and.pencil")
.resizable()
.frame(width: 50, height: 50)
) - Error Here
}
}
}
struct MainView_Previews: PreviewProvider {
static var previews: some View {
MainView()
}
}