hi I am new to ios development particularly in swift. Basically I just need to switch tab, I have tried tabBarController?.selectedIndex = 1 but it seem not to switch tab.

the image above is my story board, the initial set up is I have splitview controller the initial view that is on master is tableViewController which is A and when tapped on the accessory of cell the detail which is detail of A appear on detail of splitview and when tapped on row itself
the Tab Bar Controller replace the master
then I have four tabs in my tabBarController Tab B, Tab C, Tab D, and Tab E which is just a list when tapped it shows its respective view controller as detail of splitview then in my tab E I have 3 buttons each button designed to function to switch tab
note: the tabs and details are embedded in navigation controller
I'm a bit confuse on how and what is the standards for this. Could anyone help me any comment, suggestion would do.