I have a UITabBarController
linked to 4 UIViewController
each embedded in a NavigationViewController
.
I need to check if when one of these view controllers is currently selected, and the user clicks the same tab bar item for the same view, it will trigger an unwind segue action.
So I think I need to add a UITabBarControllerDelegate
but when I tried to add it to the UITabBarController
class in the viewDidLoad()
method:
let tabBarDel: UITabBarControllerDelegate = UITabBarControllerDelegate()
I see the following error:
'UITabBarControllerDelegate
' cannot be constructed because it has no accessible initializers
.