I am getting Json response in my parentviewcontroller
and I want to pass the array value from that response to a childviewcontroller
.
Asked
Active
Viewed 70 times
-3

Heenashree Khandelwal
- 659
- 1
- 13
- 30
-
You can set a property in child view controller and pass the value to it. There is no need using alamfire. – tomfriwel Jan 04 '18 at 07:02
1 Answers
0
Try this way
class parentVC: UIViewController {
...
let childController = UIStoryboard(name: "Storyboard-Name", bundle: nil).instantiateViewController(withIdentifier: "Child Viewcontroller Id") as? ChildVC
childController.arrayFromParent = arrayToPass //You can pass value to a variable in child viewcontroller.
}
class ChildVC: UIViewController {
var arrayFromParent = [String]()
...
}

Shezad
- 756
- 7
- 14