ProfileVC is a tab menu view. I pushed a SampleView with navigation controller from ProfileVC. If I dismiss SampleView i can see tabBar on ProfileVC but if i present ProfileVC from SampleView i cant see tabBar, it disappear.
Dismiss will be a problem for hiearchy. I need go directly profileView view
Thats push and back codes.
@IBAction func goToToolbox(_ sender: Any) {
let transition = CATransition()
transition.duration = 0.3
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
view.window!.layer.add(transition, forKey: kCATransition)
let presentedVC = self.storyboard!.instantiateViewController(withIdentifier: "ToolboxVC")
presentedVC.navigationController?.navigationBar.backgroundColor = UIColor.cyan
let nvc = UINavigationController(rootViewController: presentedVC)
present(nvc, animated: false, completion: nil)
}
@objc func didTapCloseButton(_ sender: Any) {
if let presentedVC = presentedViewController {
let transition = CATransition()
transition.duration = 0.3
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromLeft
transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
presentedVC.view.window!.layer.add(transition, forKey: kCATransition)
}
let profileVC = self.storyboard!.instantiateViewController(withIdentifier: "ProfileVC")
present(profileVC, animated: false, completion: nil)
presentedVC = nil
}