title: UITabBarController's viewControllers missing error
body: <p>Due to the overall design change in the existing well-known function,
  I have been working to replace all View Controllers connected to the UITabBarController.</p>
  <p>normally built image (it covered the contents with black)<br />
  <img src="https://i.stack.imgur.com/fEbU1l.png" alt="normally built image (it covered the contents with black)" /></p>
  <p>There was no problem when building in Xcode,
  but after uploading to TestFlight, there is a problem such as a image.</p>
  <p>problem image<br />
  <img src="https://i.stack.imgur.com/ZGElil.png" alt="problem image" /></p>
  <p>It is judged that each button properly recognizes clicks and the network communication logic moves properly.
  It's just that the view doesn't appear.</p>
  <p>At first, I thought it was a problem with the xCode version, so I tried downgrading it, but it wasn't.</p>
  <p>This problem has occurred in all practical devices such as iPhone 8+ (iOS 15), iPhone Xs (iOS 15), and iPhone 12 pro max (iOS14).</p>
  <p>It is expected that there is a problem with the TabBarController as the view appears normally on the LoginViewController without the TabBarController.</p>
  <p>I have no idea of the cause.
  Is there anyone who experienced similar problem?
  Also, if there is anyone who has solved it, please help me.</p>
  <p>Attached is the full text of TabBarcontroller's source code,
  which is used as the expected base for the content of the problem.</p>
  <pre><code>enum ViewControllerType {
      case A
      case B
      case C
      case D
      case E
      
  var vc : UIViewController {
      switch self {
  
      case .A:
          return AViewController()
      case .B:
          return BViewController(type: .example)
      case .C:
          return CViewController()
      case .D:
          return DViewController()
      case .E:
          return EViewController()
      }
  }
  
  var tabBarImage : UIImage {
      switch self {
  
      case .A:
          return UIImage(named:&quot;TABBAR_A_INACTIVE&quot;)!
      case .B:
          return UIImage(named:&quot;TABBAR_B_INACTIVE&quot;)!
      case .C:
          return UIImage(named:&quot;TABBAR_C_INACTIVE&quot;)!
      case .D:
          return UIImage(named:&quot;TABBAR_D_INACTIVE&quot;)!
      case .E:
          return UIImage(named:&quot;TABBAR_E_INACTIVE&quot;)!
      
      }
  }
  
  var selectedImage : UIImage? {
      switch self {
      case .A:
          return UIImage(named:&quot;TABBAR_A_ACTIVE&quot;)!
      default:
          return nil
      }
      
  }
  </code></pre>
  <p>}</p>
  <pre><code>class BaseTabBarController : UITabBarController {
  
  let userUtil = UserUtil.sharedInstance
  
  lazy var vcType : [ViewControllerType] = [.A,
                                            .B,
                                            .C,
                                            .D,
                                            .E]
  
  
  override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(false)
      
      self.navigationController?.setNavigationBarHidden(true, animated: false)
      self.navigationController?.title = nil
  }
  
  override func viewDidLoad() {
      super.viewDidLoad()
      self.delegate = self
      self.tabBar.tintColor = UIColor.C51_51_51
      self.tabBar.isTranslucent = false
      self.tabBar.barTintColor = UIColor(red: 248, green: 248, blue: 248)
      let appearance = tabBar.standardAppearance
      appearance.shadowColor = .C238_238_238
      self.viewControllers = self.subViewControllers(self.vcType)
      centralizeTabBarImage()
  }
  
  func subViewControllers( _ types : [ViewControllerType]) -&gt; [UIViewController] {
      return types.map { type -&gt; UIViewController in
          let vc = type.vc
          vc.tabBarItem.image = type.tabBarImage
          vc.tabBarItem.selectedImage = type.selectedImage
          let nvc = BaseNavigationViewController(rootViewController:vc)
          return nvc
      }
  }
  
  func centralizeTabBarImage() {
      
      let tabBarItems = tabBar.items!
      tabBarItems.forEach {
          $0.imageInsets = UIEdgeInsets(top: 8, left: 0, bottom: -4, right: 0)
          $0.title = nil
      }
  }
  
  override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
      
  }
  </code></pre>
  <p>}</p>
  <pre><code>extension BaseTabBarController : UITabBarControllerDelegate {
      
      func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -&gt; Bool {
          
          guard let nvc = viewController as? BaseNavigationViewController else { return false }
          
          switch nvc.viewControllers[0] {
          
          case is AViewController:
              
              let tmp = nvc.viewControllers[0].navigationController?.visibleViewController as? AViewController
              if tmp == nil {
                  nvc.viewControllers[0].navigationController?.visibleViewController?.navigationController?.popToRootViewController(animated: false)
              }
              
              break
              
          case is BViewController:
              
              if (!userUtil.isLogin) {
                  let vc = LoginViewController()
                  let nvc = BaseNavigationViewController(rootViewController: vc)
  
                  navigationController?.present(nvc, animated: true)
  
                  return false
              }
              
              let tmp = nvc.viewControllers[0].navigationController?.visibleViewController as? BViewController
              if tmp == nil {
                  nvc.viewControllers[0].navigationController?.visibleViewController?.navigationController?.popToRootViewController(animated: false)
              }
              
              break
              
              
          case is CViewController:
              
              let tmp = nvc.viewControllers[0].navigationController?.visibleViewController as? CViewController
              if tmp == nil {
                  nvc.viewControllers[0].navigationController?.visibleViewController?.navigationController?.popToRootViewController(animated: false)
              }
              
              break
              
          case is DViewController:
              
              if (!userUtil.isLogin) {
                  let vc = LoginViewController()
                  let nvc = BaseNavigationViewController(rootViewController: vc)
  
                  navigationController?.present(nvc, animated: true)
  
                  return false
              }
              else {
                  if (userUtil.address == nil || userUtil.address == &quot;&quot;) {
                      let vc = ExceptionViewController()
                      let nvc = BaseNavigationViewController(rootViewController: vc)
                      
                      navigationController?.present(nvc, animated: true)
                      
                      return false
                  }
              }
              
              let tmp = nvc.viewControllers[0].navigationController?.visibleViewController as? DController
              if tmp == nil {
                  nvc.viewControllers[0].navigationController?.visibleViewController?.navigationController?.popToRootViewController(animated: false)
              }
              
              break
              
          case is EViewController:
              
              if (!userUtil.isLogin) {
                  let vc = EViewController()
                  let nvc = BaseNavigationViewController(rootViewController: vc)
  
                  navigationController?.present(nvc, animated: true)
  
                  return false
              }
              
              let tmp = nvc.viewControllers[0].navigationController?.visibleViewController as? EViewController
              if tmp == nil {
                  nvc.viewControllers[0].navigationController?.visibleViewController?.navigationController?.popToRootViewController(animated: false)
              }
              
              break
              
          default:
              break
          }
  
          return true
          
      }
      
      func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
          printLog(viewController)
      }
  }
  </code></pre>