SSCustomTabbar icon indicating copy to clipboard operation
SSCustomTabbar copied to clipboard

Unable to set the default chosen tab.

Open KirlosYousef opened this issue 5 years ago • 1 comments

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.

KirlosYousef avatar Feb 19 '20 12:02 KirlosYousef

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

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

akhilftech avatar May 27 '22 12:05 akhilftech

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 😊.

vraj-s-shah avatar Nov 29 '22 10:11 vraj-s-shah

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

mobile-simformsolutions avatar Nov 30 '22 05:11 mobile-simformsolutions