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
Post a Comment