UIViewController *presentingViewController = [[[UIApplication sharedApplication] delegate] window].rootViewController;
//因為一個ViewController只能present新的VC一次,故如果它present過了,就去抓取它present出來的VC來再present新的VC
if (presentingViewController.presentedViewController != nil)
{
presentingViewController = presentingViewController.presentedViewController;
}
[presentingViewController presentViewController:alertController animated:YES completion:nil];
沒有留言:
張貼留言