How do I change a variable in an if statement (Swift UI)?


                        if madeAssignment.isCompleted == shouldBeCompleted{

                            NavigationLink(destination: (AssignmentDetailView(madeAssignment: madeAssignment, classes: Classes))) {

                                AssignmentTileView(madeAssignment: madeAssignment, classes: Classes)

                            }

                            .buttonStyle(.plain)

                        } else if textShown != true {

                            Text(noEventsText)

                                .bold()

                                .fontWeight(.medium)

                                .multilineTextAlignment(.center)

                                .padding(.top, 50)

                                .padding(.horizontal, 5)
textShown = true

                            

                        }

                    }

Above is the code I am going to be talking about. The error I get with this code is 'Type '()' Cannot conform to 'view''

I am making a view that shows a list of assignment tiles, and is specificys whether when it is displayed we want the completed assignments or not. When I say 'if madeAssignment.isCompleted == shouldBeCompleted', the computer is seeing whether the bool value of whether the assignment is completed or not is equal to 'shouldBeCompleted', a bool variable specified when I call this view in other views in my app telling the computer if we want a list of completed or not completed assignments returned. Then the else if is to say that if the assignment passed in the for each is not equal to should be completed, then it is asking whether text is shown (a variable created earlier in the view). Then I show no events text and set text shown to true because we never want the text to show again, because there only needs to be one text saying that there are no assignments supposed to be showing. Let me know what I am doing wrong. Thanks

How do I change a variable in an if statement (Swift UI)?
 
 
Q