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

Unable to set the default chosen tab. #17

Closed
KirlosYousef opened this issue Feb 19, 2020 · 3 comments
Closed

Unable to set the default chosen tab. #17

KirlosYousef opened this issue Feb 19, 2020 · 3 comments

Comments

@KirlosYousef
Copy link

KirlosYousef commented Feb 19, 2020

Hello,

I have been trying to set the default chosen tab view when the app starts but it's not working, Could you please tell me how can I do that?
I am using SwiftUI

Thank you.

@akhilftech
Copy link

Just add the Below code(In my case selected tab is 2)

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.tabBarController?.selectedIndex = 2
}

@vraj-s-shah
Copy link
Contributor

Hi @KirlosYousef, you can use SSTabConfiguration() to set selected tab while using SwiftUI. Refer to the example given below:

let tabBarView = SwiftUITabBarController(tabItems: [vc1, vc2, vc3, vc4, vc5], configuration: .constant(SSTabConfiguration(selectedIndex = 1)), isTabBarHidden: self.$isTabBarHidden)

Thank you for reaching us out, hope this helps 😊.

@mobile-simformsolutions
Copy link
Collaborator

@KirlosYousef Functionality is available in the latest release version 2.0.7.

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

4 participants