title: App Crashes when attempting to present sheet over view when using SwiftUI
body: <p>I am trying to present a view over another view in SwiftUI using <a href="https://developer.apple.com/documentation/swiftui/sheet" rel="nofollow noreferrer">.sheet()</a>. When this runs my app crashes <strong>with no stack trace even when run on a simulator</strong> and this error displayed: </p>
  
  <pre><code>    EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  </code></pre>
  
  <p>I have already determined that the view that is being presented is not the problem by attempting to present Text("Test") instead of my custom view but I still get the same error. </p>
  
  <pre><code>.sheet(isPresented: self.$isPresenting) { () -&gt; Text in
      return Text("This is a test")
   }
  </code></pre>
  
  <p>This is the code that sets up the view and attempts to present another view <strong>when the green button is pressed</strong>. It looks like this on the device:</p>
  
  <p><a href="https://i.stack.imgur.com/aV4CN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aV4CN.png" alt="enter image description here"></a></p>
  
  <pre><code>struct WeekView: View {
  
      @ObjectBinding var currentMealPlan = MealPlan(totalMealExchanges: 0, totalGraciesMeals: 0)
      @State var isPresenting = false
      var body: some View {
  
          NavigationView{
          VStack{
  
  
              VStack(alignment: .leading){
                  Text("Meals at Gracies remaining: ?/\(currentMealPlan.totalGraciesMeals)")
                  Text("Meal Exchanges Remaining: ?/\(currentMealPlan.totalMealExchanges)")
              }
  
  
  
              List{
                  Section(header: Text("Monday")) {
                      HStack{
  
  
                          MealView(meal: "Breakfast", location: "Dorm ", color: Color.green)
                              .tapAction {
                                  self.isPresenting.toggle()
  
                          }
                          .sheet(isPresented: self.$isPresenting) { () -&gt; Text in
                                      return Text("This is a test")
                                  }
  
  
  
                          MealView(meal: "Lunch", location: "Gracies", color: Color.blue)
                          MealView(meal: "Dinner", location: "Salsarita", color: Color.yellow)
  
  
  
                      }
                  }
  
  
    Section(header: Text("Tuesday")) {
                      Text("Hello World")
  
                  }
  
                  Section(header: Text("Wednesday")) {
                      Text("Hello World")
  
                  }
  
                  Section(header: Text("Thursday")) {
                      Text("Hello World")
  
                  }
                  Section(header: Text("Friday")) {
                      Text("Hello World")
  
                  }
  
                  Section(header: Text("Saturday")) {
                      Text("Hello World")
  
                  }
  
                  Section(header: Text("Sunday")) {
                      Text("Hello World")
  
                  }
  
  
              }
  
   }.navigationBarTitle("This Week")
              .navigationBarItems(trailing: Button(action: {
  
              }, label: {
                  Text("Help")
              }))
  
      }
  
      }
  }
  
  
  
  
  
  struct MealView: View {
      @State var meal: String
      @State var location: String
      @State var color: Color
      @State private var showPopover = false
  
      var body: some View {
          ZStack{
              Rectangle()
                  .fill(color)
              VStack{
                  Text(meal)
                      .bold()
                  Text(location)
                      .lineLimit(2)
                      }
  
  
          }
      }}
  </code></pre>
  
  <pre><code>class MealPlan: BindableObject   {
  
      let willChange =  PassthroughSubject&lt;Void, Never&gt;
  
      var totalMealExchanges: Int {didSet {willChange.send()}}
      var totalGraciesMeals: Int {didSet {willChange.send()}}
  
      init(totalMealExchanges: Int, totalGraciesMeals: Int) {
          self.totalGraciesMeals = totalGraciesMeals
          self.totalMealExchanges = totalMealExchanges
      }
  
  }
  
  </code></pre>