From c6b667dfaa94526507a9df191e2a41ce49d4330f Mon Sep 17 00:00:00 2001 From: Marc Wustrack Date: Wed, 9 Jul 2014 17:03:08 +0200 Subject: [PATCH] Fixed iPad modally shown ViewControler offset --- TSMessages/Classes/TSMessage.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TSMessages/Classes/TSMessage.m b/TSMessages/Classes/TSMessage.m index 59e6bfd6..0ee6708c 100755 --- a/TSMessages/Classes/TSMessage.m +++ b/TSMessages/Classes/TSMessage.m @@ -236,6 +236,14 @@ - (void)fadeInCurrentNotification } } + if(currentView.viewController.presentingViewController) + { + //If we show the Message on an modally presented VC we need to adjust for possible y offsets (UIModalPresentationPageSheet etc.) + CGFloat yOrigin = [currentView.viewController.presentingViewController.view convertRect:currentView.viewController.view.bounds fromView:currentView.viewController.view].origin.y; + + verticalOffset -= yOrigin; + } + CGPoint toPoint; if (currentView.messagePosition == TSMessageNotificationPositionTop) {