Skip to content

Commit f2461e3

Browse files
committed
Merge pull request Sumi-Interactive#21 from aporat/master
fixed issue that keyboard won't show up in iOS 5 after SIAlertView is dismissed
2 parents e415213 + b1142c1 commit f2461e3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

SIAlertView/SIAlertView.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
@interface SIAlertView ()
4040

4141
@property (nonatomic, strong) NSMutableArray *items;
42+
@property (nonatomic, strong) UIWindow *oldKeyWindow;
4243
@property (nonatomic, strong) UIWindow *alertWindow;
4344
@property (nonatomic, assign, getter = isVisible) BOOL visible;
4445

@@ -304,6 +305,8 @@ - (void)addButtonWithTitle:(NSString *)title type:(SIAlertViewButtonType)type ha
304305

305306
- (void)show
306307
{
308+
self.oldKeyWindow = [[UIApplication sharedApplication] keyWindow];
309+
307310
if (![[SIAlertView sharedQueue] containsObject:self]) {
308311
[[SIAlertView sharedQueue] addObject:self];
309312
}
@@ -438,6 +441,8 @@ - (void)dismissAnimated:(BOOL)animated cleanup:(BOOL)cleanup
438441
[SIAlertView hideBackgroundAnimated:YES];
439442
}
440443
}
444+
445+
[self.oldKeyWindow makeKeyAndVisible];
441446
}
442447

443448
#pragma mark - Transitions

0 commit comments

Comments
 (0)