ESTabBarController icon indicating copy to clipboard operation
ESTabBarController copied to clipboard

Tab items broken

Open brightsider opened this issue 8 months ago • 0 comments

I migrated from CocoaPods 2.8 to SPM 2.9 and tab bar items gone.

Before: Image

After: Image

Here is how I init controller based on ESTabBarController:

        let imageSize = CGSize(width: 1, height: 1)
        tabBar.isTranslucent = false
        tabBar.backgroundImage = UIImage(color: .white, size: imageSize)
        tabBar.shadowImage = UIImage(color: UIColor(hex: 0xF2F2F2)!, size: imageSize)
        shouldHijackHandler = { tabbarController, viewController, index in
            if index == 1 {
                return true
            }
            return false
        }
        didHijackHandler = { tabbarController, viewController, index in
            Analytics.logEvent(.tabAdd)
            self.addPressed()
        }
        
        let vc1 = UIStoryboard(name: "Home", bundle: nil).instantiateInitialViewController()!
        vc1.tabBarItem = ESTabBarItem(TabBarItemContentView(), title: nil, image: #imageLiteral(resourceName: "tab-home"), selectedImage: nil)
        
        let vc2 = UIViewController()
        vc2.tabBarItem = ESTabBarItem(addTabBarItemContentView, title: nil, image: #imageLiteral(resourceName: "tab-add"), selectedImage: nil)
        
        let vc3 = UIStoryboard(name: "Profile", bundle: nil).instantiateInitialViewController()!
        vc3.tabBarItem = ESTabBarItem(TabBarItemContentView(), title: nil, image: #imageLiteral(resourceName: "tab-profile"), selectedImage: nil)
        
        viewControllers = [LTNavigationController(rootViewController: vc1),
                           vc2,
                           LTNavigationController(rootViewController: vc3)]

TabBarItemContentView modifies only colors

How to fix it?

brightsider avatar Apr 29 '25 09:04 brightsider