Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOW TO NAVIGATE THE ANOTHER TABBAR ON BUTTON CLICK #20

Open
Shubham0816 opened this issue Dec 22, 2020 · 2 comments
Open

HOW TO NAVIGATE THE ANOTHER TABBAR ON BUTTON CLICK #20

Shubham0816 opened this issue Dec 22, 2020 · 2 comments

Comments

@Shubham0816
Copy link

No description provided.

@MeetBudheliya
Copy link

MeetBudheliya commented Sep 5, 2022

i'm trying to find it, but not get it...
@Ahmadalsofi Please guide us if you have any idea about this...

@khushalhoch23
Copy link

khushalhoch23 commented Apr 8, 2024

@Ahmadalsofi

I have solution for above issue, follow the steps.

Line No : 137 , Class SOTabBar

func didSelectTab(index: Int) {
        if index + 1 == selectedIndex {return}
        animateTitle(index: index)
 
        previousSelectedIndex = selectedIndex
        selectedIndex  = index + 1
        
        delegate?.tabBar(self, didSelectTabAt: index)
        animateCircle(with: circlePath)
        animateImage()
        
        guard let image = self.viewControllers[index].tabBarItem.selectedImage else {
            fatalError("You should insert selected image to all View Controllers")
        }
        self.tabSelectedImageView.image = image
    }

Step 2: class SOTabBarController, set below function at line no : 77

func preSelectedIndex(index: Int){
        self.tabBar.didSelectTab(index: index)
    }

Step 3: Call the function from your Tabbar class

class UTabbarVC: SOTabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.delegate = self
// your VC setup here
...
// set here you want to selected index
preSelectedIndex(index: 1)
      }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants