Skip to content

Commit

Permalink
Merge pull request #6417 from vishalduggal/timob-18075
Browse files Browse the repository at this point in the history
[TIMOB-18075] Restore Focus to top WindowProxy
  • Loading branch information
jonalter committed Dec 3, 2014
2 parents 64cc338 + dccfb5c commit b54e6bf
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions iphone/Classes/TiRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1137,11 +1137,30 @@ - (BOOL)shouldAutorotate{

-(void)incrementActiveAlertControllerCount
{
++activeAlertControllerCount;
if ([TiUtils isIOS8OrGreater]){
++activeAlertControllerCount;
}
}
-(void)decrementActiveAlertControllerCount
{
--activeAlertControllerCount;
if ([TiUtils isIOS8OrGreater]) {
--activeAlertControllerCount;
if (activeAlertControllerCount == 0) {
UIViewController* topVC = [self topPresentedController];
if (topVC == self) {
[self didCloseWindow:nil];
} else {
[self dismissKeyboard];

if ([topVC respondsToSelector:@selector(proxy)]) {
id theProxy = [(id)topVC proxy];
if ([theProxy conformsToProtocol:@protocol(TiWindowProtocol)]) {
[(id<TiWindowProtocol>)theProxy gainFocus];
}
}
}
}
}
}

-(NSUInteger)supportedOrientationsForAppDelegate;
Expand Down

0 comments on commit b54e6bf

Please sign in to comment.