yervandsar/ExpandedTabBar

didSelect delegate function seems broken !?

undeaDD opened this issue · 4 comments

didSelect only gets called for items inside the more container?
the other tabBarItems outside get ignored :S

this cant even be circumvented by conforming to UITabBarControllerDelegate ( redundant conformance to UITabBarControllerDelegate )

( tested on latest version & iphone 11 )
really like v3.0.0 otherwise ^^ great job

@undeaDD if you see this method in ExpandedDelegation

    func expandedTabBarController(_ tabBarController: UITabBarController,
                                  didSelect viewController: UIViewController,
                                  withItem tabBarItem: UITabBarItem?) {
        // Do some logic here
    }

You can get other select actions with overriding parent's implementation like this in your view controller.

    override func tabBarController(_ tabBarController: UITabBarController,
                                                        didSelect viewController: UIViewController) {
        super.tabBarController(tabBarController, didSelect: viewController)
        // Your logic
    }

NOTE: super.tabBarController(tabBarController, didSelect: viewController) is REQIURED

BTW it will added as soon as posible.

another thing that came to my attention:
"parentContainerView" inside:
"internal func refreshContainerPosition(with size: CGSize)"
is nil and crashes the app when less than 6 viewcontrollers are assigned

but that could easily be my fault.
i use a hybrid approach (storyboard + programmatically viewcontroller assigning)

Screenshot 2020-06-20 at 22 46 53

calling the dedicated setup function wont help here either because there may be less than 6 viewcontrollers ( dynamically assigned at runtime )

Screenshot 2020-06-20 at 22 47 33