0

I displayed all phones contacts and I want to send selected contacts to another view controller. I took the selected data into array. There is no segue between two view controllers. I want to send data with out using segue.

Lahari Areti
  • 627
  • 2
  • 10
  • 30
  • Are you moving to that controller after selection? If yes, then which technique are you using to move? – Dipak Kacha Nov 07 '17 at 12:51
  • https://stackoverflow.com/questions/39929592/how-to-push-and-present-to-uiviewcontroller-programmatically-without-segue-in-io – Krishnarjun Banoth Nov 07 '17 at 12:51
  • " to another view controller" And how are they linked? What's the order of navigation? Childs? What's your ViewController architecture in your app? How do you present the second one? – Larme Nov 07 '17 at 12:54
  • I want to navigate from default contact view controller to another view controller. I want to use storyboard id – Lahari Areti Nov 07 '17 at 13:04

1 Answers1

1

You can instantiate the destination view controller using storyboard instance and pass the data further :

let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller = storyboard.instantiateViewController(withIdentifier: "TestViewController") as! TestViewController
controller.variableX = self.variableX
self.present(controller, animated: true, completion: nil)
Nitish
  • 13,845
  • 28
  • 135
  • 263