I am trying to use UITabBarController in swift 4.2: https://developer.apple.com/documentation/uikit/uitabbarcontroller to navigate between 2 views, lets say ViewController1 and ViewController2 , each of these controllers being embedded in his own navigation controller. I am using swift 4.2 and deployment target is IOS 12.1. (Image with storyboard and controllers)
But it seems the default behavior is that to go to another tab you need 2 clicks(taps) as described also in Why i need to tap tabBarViewController item Twice to navigate to different View Controller - iOS
At first I thought it is something that I am doing wrong, but also trying the template provided by the IOS team for the tab bar it seems that the workflow is the same.
I created the UITabBarController from the storyboard. I also tried creating a custom tab bar class but did not manage to make it work. If I click once on ViewController2's tab, the viewDidLoad() and viewDidAppear() for ViewController2 are being called but the UI is not refreshed. After clicking anywhere in View or try to scroll the View is refreshed with the correct ViewController2.
Can you help me with this issue please? How can I make UITabBarController respond to a single click for a tab?