更新时间:2023-02-01 19:21:58
如果是root就可以了
You can do this if it's the root
if let vc = self.window?.rootViewController as? ViewController {
vc.result.text = u
}
要获得完整的解决方案,您应该使用 获得最***的 UIViewController 获得最***的 vc,然后像上面一样投射
For a complete solution you should get the top most vc with Get top most UIViewController then cast it like above