ios - How to pass data from View controller to Container? -
i'm new in using swift programming , need pass data container view.
i have variables passed in eyewear detail view controller vc passed container connected table.
in this, have dictionary of information put in table.
i've been scratching head find answer no luck on google search. perhaps guys can me. thanks!
set segue identifier in storyboard, first of all. find field can set identifier after click segue link.
view controller call next viewcontroller
func showsomeviewcontroller() { self.performseguewithidentifier("testcontainer", sender: self); } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if (segue.identifier == "testcontainer") { let vc: testviewcontroller = segue.destinationviewcontroller as! testviewcontroller vc.tmpstring = "say ho" } }
and testviewcontroller
class testviewcontroller: uiviewcontroller { var tmpstring: string! override func viewdidload() { super.viewdidload() // additional setup after loading view. } }
Comments
Post a Comment