Okay so I found some code from a YouTube video where data is passed from one viewController to another and it works fine but, I need it to pass across multiple view controllers and not just one to the other.
YouTube Video along with project in desc:https://www.youtube.com/watch?v=Kpwrc1PRDsg
Here is the Code:
class ViewController: UIViewController {
@IBOutlet weak var textField: UITextField!
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let nextVC: secondViewController = segue.destinationViewController as! secondViewController
nextVC.recevedText = textField.text!
}
Then the secondViewController code:
class secondViewController: UIViewController {
var recevedText: String = ""
@IBOutlet weak var textLable: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
textLable.text = recevedText
}
I have heard of delegates before but I have a difficulty with them.