I am creating an app that has 2 View Controllers, and I am passing data using preparForSegue. I managed to pass data to variables that are declared in the second view which has a TableView. Here is what I have:
override func viewDidLoad() {
super.viewDidLoad()
}
var cprCertification : String!
var cprExpiry : String!
var scipCertification : String!
var scipExpiry : String!
var diabCertification : String!
var diabExpiry : String!
The variables above hold data passed from previous View Controller.
Below is the tuple that I would like to insert those variables in.
let training = [("CPR/First Aid", cprCertification, cprExpiry), ("SCIP", scipCertification, scipExpiry), ("Diabetes", diabCertification, diabExpiry)]
I get errors saying the controller does not have member named: cprCertification, etc. If I include the tuple training
in viewDidLoad()
, all those variables are recognizable; however, I get errors about Tableview not recognizing training
. I do not know what I am missing. I thought about placing the tuple in viewDidLoad()
and access it somehow so it can be implemented in the rest of the code, but I am unsure if it can be done and how. Or if there are other suggestions or corrections, I would greatly appreciate it!