diff --git a/SendSMS/SendSMS.m b/SendSMS/SendSMS.m index 1727ac5..fbcbaab 100644 --- a/SendSMS/SendSMS.m +++ b/SendSMS/SendSMS.m @@ -56,7 +56,7 @@ - (dispatch_queue_t)methodQueue messageController.messageComposeDelegate = self; - UIViewController *currentViewController = [UIApplication sharedApplication].keyWindow.rootViewController; + UIViewController *currentViewController = [UIApplication sharedApplication].delegate.window.rootViewController; while(currentViewController.presentedViewController) { currentViewController = currentViewController.presentedViewController; }