uitableview - Sending data from static cells in tableview in container view to view controller in Swift -


swift noob here...

i have view controller container view tableview controller because want use static cells. have label in view controller want updated textfield in static cell of container tableview. here's got, label isn't updating.

override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) {     if (segue.identifier == "tvembed") {          let newviewcontroller = segue.destinationviewcontroller as! viewcontroller          self.textfield.text = newviewcontroller.label.text       } 

i know don't have use static cells purpose me idea of how work. thanks.

you're setting textfield's text value newviewcontroller, not other way around. change assignment to:

newviewcontroller.label.text = self.textfield.text 

Comments