1

enter image description here

we have used default tabbarcontroller. Tabbar rootViewController display tabbar and other viewcontroller hidden tabbar.The bottom layout of safearea not update hight when we use interactivePopGesture. All other case its working fine

    override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    if navigationController?.viewControllers[0] == self {
        tabBarController?.tabBar.isHidden = false

    } else {
        tabBarController?.tabBar.isHidden = true

    }
}

2 Answers2

1
// i was solved this issue like that in appdelegate when iam check user already login then i will remove removeGestureRecognizer from view
 let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
            let loginPageView = mainStoryboard.instantiateViewController(withIdentifier: "CustomTabVCID") as! CustomTabVC
            let rootViewController = self.window!.rootViewController as! UINavigationController
            rootViewController.view.removeGestureRecognizer(rootViewController.interactivePopGestureRecognizer!)
            rootViewController.pushViewController(loginPageView, animated: true)

// for bottom bar
    // Use this [![enter image description here][1]][1]
    // add this line when you navigate to a ViewController hidesBottomBarWhenPushed
    let vc = storyboard.instantiateViewController(withIdentifier: VC_IDENTIFIER) as! YourViewController
        vc.hidesBottomBarWhenPushed = true
     navigationController?.pushViewController(vc, animated: true)

    // hope its work for you

    or try with Main StoryBoard!
      [1]: https://i.stack.imgur.com/IiVrj.png
Sukh
  • 1,278
  • 11
  • 19
  • https://i.stack.imgur.com/IiVrj.png applied but getting same issue When we pushed to viewcontroller its working fine but when try pop using interactivePopGesture and release interactivePopGesture gesture that time this issue occure – ishwar lal janwa Mar 11 '19 at 08:56
  • add navigation Controller on Both Controllers – Sukh Mar 11 '19 at 09:28
  • https://stackoverflow.com/questions/35427102/hide-show-tab-bar-when-push-back-swift // check this out – Sukh Mar 11 '19 at 09:31
  • above link solution is for tabbar hide show but my problem is tabbar hight when user try interactivePopGesture and release it without pop to preview controller – ishwar lal janwa Mar 11 '19 at 12:33
  • why not remove popGesture on your View Controller ? – Sukh Mar 11 '19 at 13:08
  • PopGesture removing is not a proper solution. – ishwar lal janwa Mar 11 '19 at 13:27
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/189815/discussion-between-sukhwinder-singh-and-ishwar-lal-janwa). – Sukh Mar 11 '19 at 14:17
1

// issue is in your Tabbar related view controller Properties

enter image description here

Follow Below steps:

1) selected your tabbar prfile viewcontroller

2) disable Hide Bottom bar on Push

3) enable Hide Bottom bar on Push when you push on other view controller

  • Yes its working, When we need to display tabbar then we need to disable Hide Bottom bar on Push and rest of other viewcontroller we need to set enable Hide Bottom bar on Push. Thanks – ishwar lal janwa Mar 12 '19 at 06:50