title: Is there a better way to model a floating toolbar in SwiftUI that responds to @ EnvironmentObject changes without re-rendering the whole app?
body: <p>I am building an app using SwiftUI where the root view is a tab view with four tabs. One of the app features is the ability to play a podcast while you are browsing through the app. Once the audio begins playing, I want to show a "mini player" with simple start/stop controls, and also track the current progress. </p>
  
  <p>To track progress, I have an <code>@EnvironmentObject</code> injected into the root view, which publishes play time updates, etc. so the mini player can respond. The problem I am finding is that each time the play time value changes, each tab is re-rendered (which is a bad thing) Here is some [simplified] code: </p>
  
  <pre><code>struct ContentView: View {
      @EnvironmentObject var playerManager: PlayerManager
      var body: some View {
          TabView(selection: self.$selection) {
              HomeView().tag(0)
              View2().tag(1)
              View3().tag(2)
              View4().tag(3)
          }
          .overlay(
                VStack {
                    if self.playerManager.showMiniPlayer {
                          MiniPlayerView()
                    }
                }
           )
      }
  }
  
  class PodcastPlayerManager: NSObject, ObservableObject {
      @Published private(set) var elapsedTime = ElapsedTime(progress: 0, duration: 0)
  
      // ... Things happen that cause `elapsedTime` to update
  }
  </code></pre>
  
  <p>I put a log statement in the <code>init()</code> function of <code>View2</code> and it was being called constantly...which is bad.</p>
  
  <p>My question is whether or not this is the right/best way to model something like this using SwiftUI? I also considered injecting the <code>PlayerManager</code> into the <code>MiniPlayer</code> itself, but I was using a Geometry reader on <code>ContentView</code> to help position the floating <code>MiniPlayer</code>. <code>showMiniPlayer</code> is the only variable from the <code>PlayerManger</code> that I am concerned with in the <code>ContentView</code>... everything else is self-contained within the <code>MiniPlayer</code> View.</p>