uiviewcontroller - Pass variables with PresentViewController in Swift -


i'm working on swift application , have created links other views using presentviewcontroller can't figure out how pass variables. how pass variables new view?

@ibaction func workoutpressed(sender: anyobject) {     let storyboard = uistoryboard(name: "main", bundle:nil)     let workoutview = storyboard.instantiateviewcontrollerwithidentifier("workoutview") workoutviewcontroller     self.presentviewcontroller(workoutview, animated: false, completion: nil)     //self.navigationcontroller?.pushviewcontroller(workoutview, animated: true) } 

thanks

this easier think: don't need pass parameters because can access class variables of next view controller directly.

that is, can this:

workoutview.myvar = myval 

and, when view loads, myvar have value myval. (don't forget declare in workoutviewcontroller, though).


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -