From 543aa6b78b660a4490343f68935986294b5e29f0 Mon Sep 17 00:00:00 2001 From: vleango Date: Wed, 17 Jul 2013 17:20:22 +0900 Subject: [PATCH] displaying action sheet on rootViewController's presentedViewController --- TSPopover/TSPopoverController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/TSPopover/TSPopoverController.m b/TSPopover/TSPopoverController.m index fb2fc74..87a6d5b 100644 --- a/TSPopover/TSPopoverController.m +++ b/TSPopover/TSPopoverController.m @@ -188,7 +188,12 @@ - (void) showPopoverWithPoint:(CGPoint)senderPoint UIWindow *appWindow = [[UIApplication sharedApplication] keyWindow]; //[appWindow addSubview:self.view]; - [appWindow.rootViewController.view addSubview:self.view]; + if (appWindow.rootViewController.presentedViewController != nil) { + [appWindow.rootViewController.presentedViewController.view addSubview:self.view]; + } + else { + [appWindow.rootViewController.view addSubview:self.view]; + } [UIView animateWithDuration:0.0