Skip to content

Tab items broken #296

Description

@brightsider

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions