1
有没有办法检查MyViewController
是否在窗口层次结构中? 我想知道如果我可以提出从它的UIAlertController
:在窗口层次结构中是MyViewController吗?
var alert = UIAlertController(title: "Hello", message: "Just for fun", preferredStyle: UIAlertControllerStyle.Alert)
MyViewController.presentViewController(alert, animated: true, completion: nil)
屏幕上的每个视图控制器必须是在窗口层次?你可以让viewController的实例显示alert而不是类,然后你就会知道view controller是活动的。 – Sandeep