I am new to Swift and about 5 out of 10 on the Objective-C knowledge scale.
I created a basic application with three Swift tabs. Each tab has an associated quick file file, for example. FirstViewController.swift , SecondViewController.swift , ThirdViewController.swift .
When I select the third tab, I now open the application preferences by overriding the viewDidAppear function in ThirdViewController.swift , for example:
override func viewDidAppear(animated: Bool) {
However, before opening the settings, I would like to return the active tab to the first tab. How to do it elegantly in Swift.
The following does not work:
self.tabBarController.selectedIndex = 0
Since the UIViewController class does not have a tabBarController .
Brian.
ios swift uitabbarcontroller
kauai
source share