Samah Ahmed Samah Ahmed - 2 months ago 6x
iOS Question

Initial view controller and Tab View Controller

I'm working with a single view app but also I'm using Tab View controller at one case , but the Tab view Controller must be put as initial view controller to work so how I can use Tab view controller without make it as initial view Controller?

enter image description here


When you are clicking on button to move tabbar controller

Provide a storyboard id to tabbar and use below code

Write this as a class method in appdelegate and call it on button click

        let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
        let diallerTBC = storyboard.instantiateViewControllerWithIdentifier("tabBarStoryboardId") as! UITabBarController

        self.window?.rootViewController = diallerTBC

I hope this will work