What is the best way to pass a variable from one ViewController to another in Swift?
I have a ViewController called DatePickerViewController.swift in which I capture the date set by the user with a UIDatePicker object.
I then need to access the date variable from another view controller.
Should this be done by passing data forward using Segue's or should I be creating a global variable to access from various ViewControllers?
After much research I can't figure this one out. An explanation of the best way to do this would be greatly appreciated.
Many thanks.