I have two tabs. And i want to set data from one tab to another. For example i have a code that switch to another tab:
func foundCode(code: String) {
print("Code has been found: \(code)")
// MySecondViewController.codeSetter(code);
self.tabBarController?.selectedIndex = 1;
}
What is the best way to set it? Or maybe delegate this variable... But how ?