swift3 - how to get selected text of textfield on button click? pickerview is set as an inputview to the textfield. Swift -
currently output displaying selected values pickerview inside textfields.
now question want access these values on submit button , want display in view controller how this?. let me explain scenario first vc set collectionview 1 of collectionviewcell m redirecting page.
note: know how pass data between 2 view controller. not working in case.please help.
code
@ibaction func staffatten_action(_ sender: any) { // let secondvc = self.storyboard?.instantiateviewcontroller(withidentifier: "staffattendence_secondpage") as! staffattendence_secondpage // // secondvc.a = active_text.text! // secondvc.b = active_text.text! // secondvc.c = active_text.text! // secondvc.savedata.append(year.text!) // secondvc.savedata.append(month.text!) // secondvc.savedata.append(institute.text!) } }
the problem having instantiating brand new vc , passing data it. vc presented not 1 created.
since have segue connecting 2 vcs, override prepare(for:sender:)
override func prepare(for segue: uistoryboardsegue, sender: any?) { if let vc = segue.destination as? staffattendence_secondpage { vc.a = ... vc.b = ... // pass rest of data here... } }
Comments
Post a Comment