iOS tutorial: variables in TabBar project

Simple tutorial showing how to transfer variables between ViewControllers inside TabBar project

Video tutorial :

Get the code : GitHub

To transfer variables between ViewControllers just use

// reference for viewController1 inside viewController2
let tabController = self.tabBarController?.viewControllers![0] as! FirstViewController
// getting from 1st valueA
self.labelB.text = tabController.valueA.text

Napsat komentář