77//
88
99#import " SIAlertView.h"
10- #import " UIWindow+SIUtils .h"
10+ #import " SISecondaryWindowRootViewController .h"
1111#import < QuartzCore/QuartzCore.h>
1212
1313NSString *const SIAlertViewWillShowNotification = @" SIAlertViewWillShowNotification" ;
@@ -140,7 +140,7 @@ @implementation SIAlertItem
140140
141141#pragma mark - SIAlertViewController
142142
143- @interface SIAlertViewController : UIViewController
143+ @interface SIAlertViewController : SISecondaryWindowRootViewController
144144
145145@property (nonatomic , strong ) SIAlertView *alertView;
146146
@@ -163,62 +163,11 @@ - (void)viewDidLoad
163163
164164- (void )willRotateToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation duration : (NSTimeInterval )duration
165165{
166+ [super willRotateToInterfaceOrientation: toInterfaceOrientation duration: duration];
166167 [self .alertView resetTransition ];
167168 [self .alertView invalidateLayout ];
168169}
169170
170- - (void )willAnimateRotationToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation duration : (NSTimeInterval )duration
171- {
172- if ([self respondsToSelector: @selector (setNeedsStatusBarAppearanceUpdate )]) {
173- [self setNeedsStatusBarAppearanceUpdate ];
174- }
175- }
176-
177- - (NSUInteger )supportedInterfaceOrientations
178- {
179- UIViewController *viewController = [self .alertView.oldKeyWindow currentViewController ];
180- if (viewController) {
181- return [viewController supportedInterfaceOrientations ];
182- }
183- return UIInterfaceOrientationMaskAll;
184- }
185-
186- - (BOOL )shouldAutorotateToInterfaceOrientation : (UIInterfaceOrientation)toInterfaceOrientation
187- {
188- UIViewController *viewController = [self .alertView.oldKeyWindow currentViewController ];
189- if (viewController) {
190- return [viewController shouldAutorotateToInterfaceOrientation: toInterfaceOrientation];
191- }
192- return YES ;
193- }
194-
195- - (BOOL )shouldAutorotate
196- {
197- UIViewController *viewController = [self .alertView.oldKeyWindow currentViewController ];
198- if (viewController) {
199- return [viewController shouldAutorotate ];
200- }
201- return YES ;
202- }
203-
204- - (UIStatusBarStyle)preferredStatusBarStyle
205- {
206- UIWindow *window = self.alertView .oldKeyWindow ;
207- if (!window) {
208- window = [UIApplication sharedApplication ].windows [0 ];
209- }
210- return [[window viewControllerForStatusBarStyle ] preferredStatusBarStyle ];
211- }
212-
213- - (BOOL )prefersStatusBarHidden
214- {
215- UIWindow *window = self.alertView .oldKeyWindow ;
216- if (!window) {
217- window = [UIApplication sharedApplication ].windows [0 ];
218- }
219- return [[window viewControllerForStatusBarHidden ] prefersStatusBarHidden ];
220- }
221-
222171@end
223172
224173#pragma mark - SIAlertView
0 commit comments