更新时间:2023-02-01 19:03:56
如果它是根,则可以执行此操作
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