File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -471,7 +471,7 @@ - (void)buttonTapped:(SCLButton *)btn
471471
472472-(SCLAlertViewResponder *)showTitle : (UIViewController *)vc image : (UIImage *)image color : (UIColor *)color title : (NSString *)title subTitle : (NSString *)subTitle duration : (NSTimeInterval )duration completeText : (NSString *)completeText style : (SCLAlertViewStyle)style
473473{
474- UIWindow *window = [[UIApplication sharedApplication ] keyWindow ] ;
474+ UIViewController *rootViewController = vc ;
475475
476476 self.view .alpha = 0 ;
477477
@@ -480,9 +480,9 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag
480480 self.backgroundView .frame = vc.view .bounds ;
481481
482482 // Add subviews
483- [window addSubview: _backgroundView ];
484- [window addSubview: self .view ];
485- [vc addChildViewController :self ];
483+ [rootViewController addChildViewController: self ];
484+ [rootViewController.view addSubview: _backgroundView ];
485+ [rootViewController.view addSubview :self .view ];
486486
487487 // Alert color/icon
488488 UIColor *viewColor;
You can’t perform that action at this time.
0 commit comments