I have a view1 with all controls created programmatically. Once i click on a textbook i will go to view2 which has a tableview with search bar. User can select the tableviewcell value and the value should be displayed in the View1 in the textbook control.
I want to use this view2 as user control whenever a dropdown value to be selected. I am doing this right ?
The problem here is i am able to programmatically push the view controller to view2 . But after selecting the value in View2 i am not able to segue back to View1 with the value selected.
Is this scenario possible at all? If not what would be the solution.
NOTE: I have 2 views view1 to view2. View1 acts like a data input form. View2 acts like a dropdown.
On click of button in View1 i am doing this
func ButtonPressed()
{ print("Button Pressed!!")
// This will create the new instance of the view controller.
let vc = UIStoryboard(name:"Main", bundle:nil).instantiateViewController(withIdentifier: "Storage") as! testClass
self.navigationController?.pushViewController(vc, animated:true)
}
Once view 2 is loaded then i am selecting a value in view2 and i want to segue back to the same instance of View1 so that i don't loose the values.
How can i achieve this??
Thanks in advance.