title: SwiftUI show alert based on computed property
body: <p>I'm trying to show an alert in Swift based on a computed property. Basically, whenever a user clicks on a button the value of "round" is updated. When more than 10 rounds have taken place, an alert shows.</p>
  
  <p>To do this, I've created a boolean variable called "showingAlert". This has to be a @State var so that it gets set to false again when the user closes the alert.</p>
  
  <p>However, the compiler tells me that a property wrapper like @State "cannot be applied to a computed property" :-( </p>
  
  <p>This is the code that I've tried:</p>
  
  <pre><code>
  @State var round = 0
  @State var showingAlert:Bool {round &gt; 10 ? true : false}
  
  func result(player: Int, app: Int) {
  if player &gt; app {
   round += 1
   }
  else {
   round += 1
  }
  }
  
  var body: some View {
          Button(action: {self.result(player: 1, app: 1)}) {
          Text("Button")
          }
             .alert(isPresented: $showingAlert) {
                  Alert(title: Text("title"), message: Text("message"), dismissButton: .default(Text("Continue"))
                  )
  } 
  </code></pre>
  
  <p>Is there any way round this? I'd love to create an alert that shows without error messages.</p>