我正在尝试将数据从父 View Controller (容器 View )发送到它的 subview Controller 。
我尝试通过 segue 发送数据,但我收到了这个错误 “无法将‘UIViewController’类型的值 (0x10d30d1f0) 转换为‘ContainerDeom.ChildVC’”
ContainerDeom:是项目名
ChildVC:容器 View 的 subview
最佳答案
试试这段代码
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
}
关于ios - 将数据从父 View Controller 传递到 subview Controller Swift 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51345877/