Pushing a view controller from SideMenu pod causes a flash/dark screen for a second and appears normal

24 Views Asked by At

It is only appearing when I am make tab bar programatically, when using the tab bar controller with storyboard it is not showing this blink. For a custom tab bar I need to use the programatically made tab bar. I have found a solution for the following and this is the link but by implementation of it , the error is not going it is still there. the solution. Link:- https://github.com/jonkykong/SideMenu/issues/561 . tab bar code :

static func showTabBar() -> TabBarViewController {

    let tabItems = TabItems.getTabs()

    var nvControllers = [UINavigationController]()

    for tabItem in tabItems {
        let controller = tabItem.getStoryBoard().instantiateController(ofType: tabItem.getViewControllerType())
        if case TabItems.Home = tabItem {
            let nv = HomeNavigationController(rootViewController: controller)
            nv.title = tabItem.getNavAndTabTitle()
            nvControllers.append(nv)
        } else {
            let nv = UINavigationController(rootViewController: controller)
            nv.title = tabItem.getNavAndTabTitle()
            nvControllers.append(nv)
        }
    }

    nvControllers.forEach { $0.setNavigationBarHidden(true, animated: false) }

    let tabBarController = TabBarViewController()
    tabBarController.setViewControllers(nvControllers, animated: true)

    let tabImages = TabItems.getTabImages()

    if let items = tabBarController.tabBar.items {
        for x in 0..<items.count {
            items[x].image = UIImage(named: tabImages[x] + "_unselected")
            items[x].selectedImage = UIImage(named: tabImages[x] + "_selected")
        }
    }

    return tabBarController
}
0

There are 0 best solutions below