eggswift / ESTabBarController

:octocat: ESTabBarController is a Swift model for customize UI, badge and adding animation to tabbar items. Support lottie!
MIT License
5.17k stars 578 forks source link

How to show bottom TabBar on all pushed VC #258

Open jis248 opened 2 years ago

jis248 commented 2 years ago

This code is on ViewController not on AppDelegate

 let v1 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
        let v2 = self.storyboard?.instantiateViewController(withIdentifier: "TaskVC") as! TaskVC
        let v3 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
        let v4 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController
        let v5 = self.storyboard?.instantiateViewController(withIdentifier: "Temp1ViewController") as! Temp1ViewController

        v1.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Home", image: UIImage(named: "home"), selectedImage: UIImage(named: "home2"))
        v2.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen2", image: UIImage(named: "Screen2"), selectedImage: UIImage(named: "Screen2"))
        v3.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen3", image: UIImage(named: "Screen3"), selectedImage: UIImage(named: "Screen3"))
        v4.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen4", image: UIImage(named: "Screen4"), selectedImage: UIImage(named: "Screen4"))
        v5.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen5", image: UIImage(named: "Screen5"), selectedImage: UIImage(named: "Screen5"))

        self.delegate = self
        self.viewControllers = [v1,v2,v3,v4,v5]