Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes "Unable to find UIManager module" warning #6043

Merged
merged 1 commit into from
Mar 16, 2020
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
2 changes: 1 addition & 1 deletion lib/ios/ModalTransitionDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@interface ModalTransitionDelegate : TransitionDelegate

- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransition uiManager:(RCTUIManager *)uiManager;
- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransition bridge:(RCTBridge *)bridge;

@property (nonatomic, strong) TransitionOptions* contentTransitionOptions;

Expand Down
4 changes: 2 additions & 2 deletions lib/ios/ModalTransitionDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

@implementation ModalTransitionDelegate

- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransitionOptions uiManager:(RCTUIManager *)uiManager {
self = [super initWithUIManager:uiManager];
- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransitionOptions bridge:(RCTBridge *)bridge {
self = [super initWithBridge:bridge];
_contentTransitionOptions = contentTransitionOptions;
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ios/RNNBridgeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
RNNEventEmitter *eventEmitter = [[RNNEventEmitter alloc] init];
_modalManager = [[RNNModalManager alloc] initWithUIManager:_bridge.uiManager];
_modalManager = [[RNNModalManager alloc] initWithBridge:bridge];

id<RNNComponentViewCreator> rootViewCreator = [[RNNReactRootViewCreator alloc] initWithBridge:bridge eventEmitter:eventEmitter];
_componentRegistry = [[RNNReactComponentRegistry alloc] initWithCreator:rootViewCreator];
Expand Down
4 changes: 2 additions & 2 deletions lib/ios/RNNModalManager.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <React/RCTUIManager.h>
#import <React/RCTBridge.h>

typedef void (^RNNTransitionCompletionBlock)(void);
typedef void (^RNNTransitionWithComponentIdCompletionBlock)(NSString *componentId);
Expand All @@ -16,7 +16,7 @@ typedef void (^RNNTransitionRejectionBlock)(NSString *code, NSString *message, N

@interface RNNModalManager : NSObject <UIAdaptivePresentationControllerDelegate>

- (instancetype)initWithUIManager:(RCTUIManager *)uiManager;
- (instancetype)initWithBridge:(RCTBridge *)bridge;

@property (nonatomic, weak) id<RNNModalManagerDelegate> delegate;

Expand Down
11 changes: 5 additions & 6 deletions lib/ios/RNNModalManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,20 @@ @interface RNNModalManager ()
@implementation RNNModalManager {
NSMutableArray* _pendingModalIdsToDismiss;
NSMutableArray* _presentedModals;
RCTUIManager* _uiManager;
RCTBridge* _bridge;
}


- (instancetype)init {
self = [super init];
_pendingModalIdsToDismiss = [[NSMutableArray alloc] init];
_presentedModals = [[NSMutableArray alloc] init];

return self;
}

- (instancetype)initWithUIManager:(RCTUIManager *)uiManager {
- (instancetype)initWithBridge:(RCTBridge *)bridge {
self = [self init];
_uiManager = uiManager;
_bridge = bridge;
return self;
}

Expand All @@ -45,7 +44,7 @@ - (void)showModal:(UIViewController<RNNLayoutProtocol> *)viewController animated
}

if (viewController.resolveOptionsWithDefault.animations.showModal.hasAnimation) {
_modalTransitionDelegate = [[ModalTransitionDelegate alloc] initWithContentTransition:viewController.resolveOptionsWithDefault.animations.showModal uiManager:_uiManager];
_modalTransitionDelegate = [[ModalTransitionDelegate alloc] initWithContentTransition:viewController.resolveOptionsWithDefault.animations.showModal bridge:_bridge];
viewController.transitioningDelegate = _modalTransitionDelegate;
viewController.modalPresentationStyle = UIModalPresentationCustom;
}
Expand Down Expand Up @@ -101,7 +100,7 @@ - (void)removePendingNextModalIfOnTop:(RNNTransitionCompletionBlock)completion {
UIViewController* topPresentedVC = [self topPresentedVC];

if (optionsWithDefault.animations.dismissModal.hasAnimation) {
_modalTransitionDelegate = [[ModalDismissTransitionDelegate alloc] initWithContentTransition:modalToDismiss.resolveOptionsWithDefault.animations.dismissModal uiManager:_uiManager];
_modalTransitionDelegate = [[ModalDismissTransitionDelegate alloc] initWithContentTransition:modalToDismiss.resolveOptionsWithDefault.animations.dismissModal bridge:_bridge];
[self topViewControllerParent:modalToDismiss].transitioningDelegate = _modalTransitionDelegate;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ios/StackControllerDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ - (void)sendScreenPoppedEvent:(UIViewController *)poppedScreen {
fromViewController:(UIViewController*)fromVC
toViewController:(UIViewController*)toVC {
if (operation == UINavigationControllerOperationPush && toVC.resolveOptions.animations.push.hasCustomAnimation) {
return [[StackTransitionDelegate alloc] initWithScreenTransition:toVC.resolveOptions.animations.push uiManager:_eventEmitter.bridge.uiManager];
return [[StackTransitionDelegate alloc] initWithScreenTransition:toVC.resolveOptions.animations.push bridge:_eventEmitter.bridge];
} else if (operation == UINavigationControllerOperationPop && fromVC.resolveOptions.animations.pop.hasCustomAnimation) {
return [[StackTransitionDelegate alloc] initWithScreenTransition:fromVC.resolveOptions.animations.pop uiManager:_eventEmitter.bridge.uiManager];
return [[StackTransitionDelegate alloc] initWithScreenTransition:fromVC.resolveOptions.animations.pop bridge:_eventEmitter.bridge];
} else {
return nil;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ios/StackTransitionDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

@interface StackTransitionDelegate : TransitionDelegate

- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition uiManager:(RCTUIManager *)uiManager;
- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition bridge:(RCTBridge *)bridge;

@end
4 changes: 2 additions & 2 deletions lib/ios/StackTransitionDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ @implementation StackTransitionDelegate {
RNNScreenTransition* _screenTransition;
}

- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition uiManager:(RCTUIManager *)uiManager {
self = [super initWithUIManager:uiManager];
- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition bridge:(RCTBridge *)bridge {
self = [super initWithBridge:bridge];
_screenTransition = screenTransition;
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ios/TransitionDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@interface TransitionDelegate : NSObject <UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning, RCTUIManagerObserver>

- (instancetype)initWithUIManager:(RCTUIManager *)uiManager;
- (instancetype)initWithBridge:(RCTBridge *)bridge;

- (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC containerView:(UIView *)containerView;

Expand Down
8 changes: 4 additions & 4 deletions lib/ios/TransitionDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
#import "DisplayLinkAnimator.h"

@implementation TransitionDelegate {
RCTUIManager* _uiManager;
RCTBridge* _bridge;
id <UIViewControllerContextTransitioning> _transitionContext;
BOOL _animate;
}

- (instancetype)initWithUIManager:(RCTUIManager *)uiManager {
- (instancetype)initWithBridge:(RCTBridge *)bridge {
self = [super init];
_uiManager = uiManager;
[_uiManager.observerCoordinator addObserver:self];
_bridge = bridge;
return self;
}

- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
[_bridge.uiManager.observerCoordinator addObserver:self];
_animate = YES;
_transitionContext = transitionContext;
[self prepareTransitionContext:transitionContext];
Expand Down