remove newly created navigation bar when setting root view controller swift
<p>while pushing to tab view controller and setting it as root vie controller creating a new navigation bar above the ta bar navigation bar.</p>

<p>tab bar vc already has navigation bar with buttons and when pusing to the tab bar controller using this code creates a grey color navigation bar above the tab bar navigation controller.</p>

<p>How should i suppose to remove the newly created navigation bar.</p>

<p>i tried to search the navigation bar using the view in subviews method but not able to find</p>

<pre><code> let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
    appDelegate.window = UIWindow(frame: UIScreen.mainScreen().bounds)
    let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
    let vc  = storyboard.instantiateViewControllerWithIdentifier("Left")
    var nav = appDelegate.window?.rootViewController as? UINavigationController

    nav = UINavigationController.init(rootViewController:vc )

    hidesBottomBarWhenPushed = true

    let transition: CATransition = CATransition()
    let timeFunc : CAMediaTimingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
    transition.duration = 0.25
    transition.timingFunction = timeFunc
    transition.type = kCATransitionPush
    transition.subtype = kCATransitionFromLeft    //kCATransitionFromLeft
    nav!.view.layer.addAnimation(transition, forKey: kCATransition)
    appDelegate.window?.rootViewController = nav

    appDelegate.window?.makeKeyAndVisible()
</code></pre>