title: Displaying a published integer in SwiftUI Text
body: <p>I am fairly new to SwiftUI and ran into the following problem: </p>
  
  <p>I have a model that contains some integer values like so:</p>
  
  <pre><code>class Game: ObservableObject {
  
      @Published var ownScore:Int = 0
      @Published var opponentScore:Int = 0
  
      ... some methods
  }
  </code></pre>
  
  <p>I also need a view to display these scores and get updated whenever any of these values change.
  I would need something along the lines of this, however, this doesn't work since the values are published integers. </p>
  
  <pre><code>struct ScoreView: View {
      @EnvironmentObject var game: Game
      @State var displayOpponent: Bool
  
      var body: some View {
          VStack {
              if displayOpponent {
                  Text("Opponent Score")
                  Text("Score: \(game.$opponentScore)")
              } else {
                  Text("Your Score")
                  Text("Score: \(game.$ownScore)")
              }
  
          }
      }
  }
  </code></pre>
  
  <p>Any ideas on how to implement this correctly?</p>