ios - How do I pass an object into a view via presentViewController? -


how pass data view controller i'm presenting programmatically have created in ib? right i've got code pull view when user clicks button not clear how send data along view.

i'm trying use code below being told "value of type uiviewcontroller has no member "data""

@ibaction func showpossbutton(sender: uibutton) {      print("show data table.")       let storyboard = uistoryboard(name: "main", bundle: nil)     let vc = storyboard.instantiateviewcontrollerwithidentifier("posstable")     var data:data!     vc.data = data      self.presentviewcontroller(vc, animated: true, completion: nil)  } 

what doing wrong here?

like rob has mentioned, must cast instantiated view controller specific class has data field as! *insertviewcontrollerclassname*


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -