diff --git a/LMAlertView.podspec b/LMAlertView.podspec index 21da812..fee5c0b 100644 --- a/LMAlertView.podspec +++ b/LMAlertView.podspec @@ -8,10 +8,10 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/lmcd/LMAlertView.git', :tag => 'v1.1.0' } s.requires_arc = true - s.ios.deployment_target = '7.0' + s.ios.deployment_target = ‘7.0’ s.dependency 'RBBAnimation', '~> 0.3.0' s.dependency 'CAAnimationBlocks', '~> 0.0.1' s.public_header_files = 'LMAlertView/*.h' s.source_files = 'LMAlertView', 'LMAlertView/**/*.{h,m}' -end \ No newline at end of file +end diff --git a/LMAlertView/CALayer+ModalAlert.m b/LMAlertView/CALayer+ModalAlert.m index 085311c..4e86b94 100644 --- a/LMAlertView/CALayer+ModalAlert.m +++ b/LMAlertView/CALayer+ModalAlert.m @@ -26,8 +26,13 @@ + (void)load - (UIWindow *)windowForView:(UIView *)view { UIView *tempView = view; - + if (![tempView respondsToSelector:@selector(superview)]) { + return nil; + } while (tempView.superview != nil) { + if (![tempView respondsToSelector:@selector(superview)]) { + break; + } tempView = tempView.superview; if ([tempView isKindOfClass:[UIWindow class]]) {