title: ZStack blocks animation SwiftUI
body: <p>So my goal is to be able to show a custom view from time to time over a SwiftUI tabview, so I thought I would place them both in a ZStack like this</p>
  <pre><code>@State var show = true
  @State private var selectedTab      : Int = 0
  
  var body: some View {
      ZStack {
          TabView(selection: $selectedTab) {
              Color.pink
          }
          
          if show {
              Button(action: {
                  withAnimation(Animation.linear(duration: 10)) {
                      show = false
                  }
              }) {
                  Color.blue
              }
              .frame(width: 100, height: 100)
          }
      }
  }
  </code></pre>
  <p>This works just fine, but when I try to use withAnimation() no animation gets triggered. How can I make the overlaying view, disappear with animation?</p>