Reputation: 57
I am trying to send data from parent view controller (Container View) to its child view controller.
I've tried sending data via segue but I got this error " Could not cast value of type 'UIViewController' (0x10d30d1f0) to 'ContainerDeom.ChildVC' "
ContainerDeom: is the project name
ChildVC: The child of container view
Upvotes: 0
Views: 938
Reputation: 804
Try this code
if let controller = (self.childViewControllers.filter {$0 is urChildController}).first {
// assign ur parsed data of parent controller to your child controller
controller.dict = self.urResponseDict
}
Upvotes: 2