Check out example codes for "accessing tab bar item action swift". It will help you in understanding the concepts better.

Code Example 1

class yourclass: UIViewController, UITabBarDelegate {
    func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) {
        //This method will be called when user changes tab.
    }
}

Learn ReactJs, React Native from akashmittal.com