title: SwiftUI PageTabView in iOS14.2 will Recall ChildView onAppear method Many times
body: <p>I use TabView PageTabViewStyle with SwiftUI to display a pageview, when I swipe this TabView I find child view will Recall onAppear method Many times, Can someone tell me why?</p>
  <p><strong>This is my code</strong></p>
  <pre><code>import SwiftUI
  
  struct Pageview: View {
      
      @StateObject var vm = PageViewModel()
      
      var body: some View {
          VStack {
              
              DragViewBar().padding(.top, 14)
              
              TabView(selection: $vm.selectTabIndex) {
                  
                  TextView(index: &quot;0&quot;).tag(0)
                  TextView(index: &quot;1&quot;).tag(1)
                  TextView(index: &quot;2&quot;).tag(2)
                  TextView(index: &quot;3&quot;).tag(3)
                  TextView(index: &quot;4&quot;).tag(4)
                  TextView(index: &quot;5&quot;).tag(5)
                  
              }
              .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
              
          }
  
      }
  }
  
  struct TextView: View {
      
      let index: String
      
      var body: some View {
          VStack {
              Text(index)
          }
          .onAppear { print(index) }
          
      }
  }
  
  struct DragViewBar: View {
      var body: some View {
          Rectangle()
              .frame(width:36.0,height:5.0).foregroundColor(Color.blue)
              .cornerRadius(100)
      }
  }
  
  class PageViewModel: ObservableObject {
      @Published var selectTabIndex = 0
  }
  
  </code></pre>
  <p><strong>The result of the console printing</strong>
  <a href="https://i.stack.imgur.com/7bgsG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7bgsG.png" alt="enter image description here" /></a></p>
  <p>The correct case is to print only once per swipe</p>
  <p>It just has a problem in ios14.2, 14.1 will be ok, you can load my code in Github: <a href="https://github.com/werbhelius/TabViewBug" rel="noreferrer">https://github.com/werbhelius/TabViewBug</a></p>
  <p>Xcode version: 12.1 (12A7403)</p>
  <p>Device: iPhone 6s iOS 14.2</p>
  <p>I think you can reproduce this problem on any device in iOS 14.2</p>
  <p>I look forward to your help to solve this problem. Thank you</p>