Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions ios/RNNCommandsHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,18 @@ - (void)mergeOptions:(NSString *)componentId

UIViewController<RNNLayoutProtocol> *vc = [_layoutManager findComponentForId:componentId];
RNNNavigationOptions *newOptions = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
if ([vc conformsToProtocol:@protocol(RNNLayoutProtocol)] ||
[vc isKindOfClass:[RNNComponentViewController class]]) {
if (vc && ([vc conformsToProtocol:@protocol(RNNLayoutProtocol)] ||
[vc isKindOfClass:[RNNComponentViewController class]])) {
[CATransaction begin];
[CATransaction setCompletionBlock:completion];

[vc mergeOptions:newOptions];

[CATransaction commit];
} else {
if (completion) {
completion();
}
}
}

Expand Down Expand Up @@ -324,10 +328,10 @@ - (void)popTo:(NSString *)componentId

RNNComponentViewController *vc =
(RNNComponentViewController *)[_layoutManager findComponentForId:componentId];
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
[vc mergeOptions:options];

if (vc) {
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
[vc mergeOptions:options];

[vc.stack popTo:vc
animated:[vc.resolveOptionsWithDefault.animations.pop.enable withDefault:YES]
completion:^(NSArray *poppedViewControllers) {
Expand Down Expand Up @@ -355,25 +359,27 @@ - (void)popToRoot:(NSString *)componentId

RNNComponentViewController *vc =
(RNNComponentViewController *)[_layoutManager findComponentForId:componentId];
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
[vc mergeOptions:options];

[CATransaction begin];
[CATransaction setCompletionBlock:^{
[self->_eventEmitter sendOnNavigationCommandCompletion:popToRoot commandId:commandId];
completion();
}];

[vc.stack popToRoot:vc
animated:[vc.resolveOptionsWithDefault.animations.pop.enable withDefault:YES]
completion:^(NSArray *poppedViewControllers) {

}
rejection:^(NSString *code, NSString *message, NSError *error){

}];
if (vc) {
RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
[vc mergeOptions:options];

[CATransaction commit];
[vc.stack popToRoot:vc
animated:[vc.resolveOptionsWithDefault.animations.pop.enable withDefault:YES]
completion:^(NSArray *poppedViewControllers) {
[self->_eventEmitter sendOnNavigationCommandCompletion:popToRoot
commandId:commandId];
completion();
}
rejection:rejection];
} else {
[RNNErrorHandler
reject:rejection
withErrorCode:1012
errorDescription:
[NSString stringWithFormat:
@"PopToRoot component failed - componentId '%@' not found",
componentId]];
}
}

- (void)showModal:(NSDictionary *)layout
Expand Down
2 changes: 2 additions & 0 deletions ios/RNNOverlayManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ - (void)showOverlayWindow:(RNNOverlayWindow *)overlayWindow {
[overlayWindow setHidden:NO];

overlayWindow.previousWindow.accessibilityElementsHidden = YES;
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, overlayWindow);
}

- (void)showOverlayWindowAsKeyWindow:(RNNOverlayWindow *)overlayWindow {
Expand All @@ -41,6 +42,7 @@ - (void)dismissAllOverlays {

- (void)detachOverlayWindow:(RNNOverlayWindow *)overlayWindow {
overlayWindow.previousWindow.accessibilityElementsHidden = NO;
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);

[overlayWindow.previousWindow makeKeyWindow];
[overlayWindow setHidden:YES];
Expand Down