Browse Source

Removes unable to find UIManager module warning (#6043)

Yogev Ben David 4 years ago
parent
commit
ba1260402c
No account linked to committer's email address

+ 1
- 1
lib/ios/ModalTransitionDelegate.h View File

4
 
4
 
5
 @interface ModalTransitionDelegate : TransitionDelegate
5
 @interface ModalTransitionDelegate : TransitionDelegate
6
 
6
 
7
-- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransition uiManager:(RCTUIManager *)uiManager;
7
+- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransition bridge:(RCTBridge *)bridge;
8
 
8
 
9
 @property (nonatomic, strong) TransitionOptions* contentTransitionOptions;
9
 @property (nonatomic, strong) TransitionOptions* contentTransitionOptions;
10
 
10
 

+ 2
- 2
lib/ios/ModalTransitionDelegate.m View File

2
 
2
 
3
 @implementation ModalTransitionDelegate
3
 @implementation ModalTransitionDelegate
4
 
4
 
5
-- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransitionOptions uiManager:(RCTUIManager *)uiManager {
6
-    self = [super initWithUIManager:uiManager];
5
+- (instancetype)initWithContentTransition:(TransitionOptions *)contentTransitionOptions bridge:(RCTBridge *)bridge {
6
+    self = [super initWithBridge:bridge];
7
     _contentTransitionOptions = contentTransitionOptions;
7
     _contentTransitionOptions = contentTransitionOptions;
8
     return self;
8
     return self;
9
 }
9
 }

+ 1
- 1
lib/ios/RNNBridgeManager.m View File

88
 
88
 
89
 - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
89
 - (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
90
 	RNNEventEmitter *eventEmitter = [[RNNEventEmitter alloc] init];
90
 	RNNEventEmitter *eventEmitter = [[RNNEventEmitter alloc] init];
91
-    _modalManager = [[RNNModalManager alloc] initWithUIManager:_bridge.uiManager];
91
+    _modalManager = [[RNNModalManager alloc] initWithBridge:bridge];
92
     
92
     
93
 	id<RNNComponentViewCreator> rootViewCreator = [[RNNReactRootViewCreator alloc] initWithBridge:bridge eventEmitter:eventEmitter];
93
 	id<RNNComponentViewCreator> rootViewCreator = [[RNNReactRootViewCreator alloc] initWithBridge:bridge eventEmitter:eventEmitter];
94
 	_componentRegistry = [[RNNReactComponentRegistry alloc] initWithCreator:rootViewCreator];
94
 	_componentRegistry = [[RNNReactComponentRegistry alloc] initWithCreator:rootViewCreator];

+ 2
- 2
lib/ios/RNNModalManager.h View File

1
 #import <Foundation/Foundation.h>
1
 #import <Foundation/Foundation.h>
2
 #import <UIKit/UIKit.h>
2
 #import <UIKit/UIKit.h>
3
-#import <React/RCTUIManager.h>
3
+#import <React/RCTBridge.h>
4
 
4
 
5
 typedef void (^RNNTransitionCompletionBlock)(void);
5
 typedef void (^RNNTransitionCompletionBlock)(void);
6
 typedef void (^RNNTransitionWithComponentIdCompletionBlock)(NSString *componentId);
6
 typedef void (^RNNTransitionWithComponentIdCompletionBlock)(NSString *componentId);
16
 
16
 
17
 @interface RNNModalManager : NSObject <UIAdaptivePresentationControllerDelegate>
17
 @interface RNNModalManager : NSObject <UIAdaptivePresentationControllerDelegate>
18
 
18
 
19
-- (instancetype)initWithUIManager:(RCTUIManager *)uiManager;
19
+- (instancetype)initWithBridge:(RCTBridge *)bridge;
20
 
20
 
21
 @property (nonatomic, weak) id<RNNModalManagerDelegate> delegate;
21
 @property (nonatomic, weak) id<RNNModalManagerDelegate> delegate;
22
 
22
 

+ 5
- 6
lib/ios/RNNModalManager.m View File

12
 @implementation RNNModalManager {
12
 @implementation RNNModalManager {
13
 	NSMutableArray* _pendingModalIdsToDismiss;
13
 	NSMutableArray* _pendingModalIdsToDismiss;
14
 	NSMutableArray* _presentedModals;
14
 	NSMutableArray* _presentedModals;
15
-    RCTUIManager* _uiManager;
15
+    RCTBridge* _bridge;
16
 }
16
 }
17
 
17
 
18
 
18
 
20
 	self = [super init];
20
 	self = [super init];
21
 	_pendingModalIdsToDismiss = [[NSMutableArray alloc] init];
21
 	_pendingModalIdsToDismiss = [[NSMutableArray alloc] init];
22
 	_presentedModals = [[NSMutableArray alloc] init];
22
 	_presentedModals = [[NSMutableArray alloc] init];
23
-
24
 	return self;
23
 	return self;
25
 }
24
 }
26
 
25
 
27
-- (instancetype)initWithUIManager:(RCTUIManager *)uiManager {
26
+- (instancetype)initWithBridge:(RCTBridge *)bridge {
28
     self = [self init];
27
     self = [self init];
29
-    _uiManager = uiManager;
28
+    _bridge = bridge;
30
     return self;
29
     return self;
31
 }
30
 }
32
 
31
 
45
 	}
44
 	}
46
 	    
45
 	    
47
 	if (viewController.resolveOptionsWithDefault.animations.showModal.hasAnimation) {
46
 	if (viewController.resolveOptionsWithDefault.animations.showModal.hasAnimation) {
48
-        _modalTransitionDelegate = [[ModalTransitionDelegate alloc] initWithContentTransition:viewController.resolveOptionsWithDefault.animations.showModal uiManager:_uiManager];
47
+        _modalTransitionDelegate = [[ModalTransitionDelegate alloc] initWithContentTransition:viewController.resolveOptionsWithDefault.animations.showModal bridge:_bridge];
49
         viewController.transitioningDelegate = _modalTransitionDelegate;
48
         viewController.transitioningDelegate = _modalTransitionDelegate;
50
         viewController.modalPresentationStyle = UIModalPresentationCustom;
49
         viewController.modalPresentationStyle = UIModalPresentationCustom;
51
 	}
50
 	}
101
 	UIViewController* topPresentedVC = [self topPresentedVC];
100
 	UIViewController* topPresentedVC = [self topPresentedVC];
102
 	
101
 	
103
 	if (optionsWithDefault.animations.dismissModal.hasAnimation) {
102
 	if (optionsWithDefault.animations.dismissModal.hasAnimation) {
104
-        _modalTransitionDelegate = [[ModalDismissTransitionDelegate alloc] initWithContentTransition:modalToDismiss.resolveOptionsWithDefault.animations.dismissModal uiManager:_uiManager];
103
+        _modalTransitionDelegate = [[ModalDismissTransitionDelegate alloc] initWithContentTransition:modalToDismiss.resolveOptionsWithDefault.animations.dismissModal bridge:_bridge];
105
 		[self topViewControllerParent:modalToDismiss].transitioningDelegate = _modalTransitionDelegate;
104
 		[self topViewControllerParent:modalToDismiss].transitioningDelegate = _modalTransitionDelegate;
106
 	}
105
 	}
107
 
106
 

+ 2
- 2
lib/ios/StackControllerDelegate.m View File

30
 											   fromViewController:(UIViewController*)fromVC
30
 											   fromViewController:(UIViewController*)fromVC
31
 												 toViewController:(UIViewController*)toVC {
31
 												 toViewController:(UIViewController*)toVC {
32
 	if (operation == UINavigationControllerOperationPush && toVC.resolveOptions.animations.push.hasCustomAnimation) {
32
 	if (operation == UINavigationControllerOperationPush && toVC.resolveOptions.animations.push.hasCustomAnimation) {
33
-		return [[StackTransitionDelegate alloc] initWithScreenTransition:toVC.resolveOptions.animations.push uiManager:_eventEmitter.bridge.uiManager];
33
+		return [[StackTransitionDelegate alloc] initWithScreenTransition:toVC.resolveOptions.animations.push bridge:_eventEmitter.bridge];
34
 	} else if (operation == UINavigationControllerOperationPop && fromVC.resolveOptions.animations.pop.hasCustomAnimation) {
34
 	} else if (operation == UINavigationControllerOperationPop && fromVC.resolveOptions.animations.pop.hasCustomAnimation) {
35
-		return [[StackTransitionDelegate alloc] initWithScreenTransition:fromVC.resolveOptions.animations.pop uiManager:_eventEmitter.bridge.uiManager];
35
+		return [[StackTransitionDelegate alloc] initWithScreenTransition:fromVC.resolveOptions.animations.pop bridge:_eventEmitter.bridge];
36
 	} else {
36
 	} else {
37
 		return nil;
37
 		return nil;
38
 	}
38
 	}

+ 1
- 1
lib/ios/StackTransitionDelegate.h View File

5
 
5
 
6
 @interface StackTransitionDelegate : TransitionDelegate
6
 @interface StackTransitionDelegate : TransitionDelegate
7
 
7
 
8
-- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition uiManager:(RCTUIManager *)uiManager;
8
+- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition bridge:(RCTBridge *)bridge;
9
 
9
 
10
 @end
10
 @end

+ 2
- 2
lib/ios/StackTransitionDelegate.m View File

7
     RNNScreenTransition* _screenTransition;
7
     RNNScreenTransition* _screenTransition;
8
 }
8
 }
9
 
9
 
10
-- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition uiManager:(RCTUIManager *)uiManager {
11
-    self = [super initWithUIManager:uiManager];
10
+- (instancetype)initWithScreenTransition:(RNNScreenTransition *)screenTransition bridge:(RCTBridge *)bridge {
11
+    self = [super initWithBridge:bridge];
12
     _screenTransition = screenTransition;
12
     _screenTransition = screenTransition;
13
     return self;
13
     return self;
14
 }
14
 }

+ 1
- 1
lib/ios/TransitionDelegate.h View File

5
 
5
 
6
 @interface TransitionDelegate : NSObject <UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning, RCTUIManagerObserver>
6
 @interface TransitionDelegate : NSObject <UIViewControllerTransitioningDelegate, UIViewControllerAnimatedTransitioning, RCTUIManagerObserver>
7
 
7
 
8
-- (instancetype)initWithUIManager:(RCTUIManager *)uiManager;
8
+- (instancetype)initWithBridge:(RCTBridge *)bridge;
9
 
9
 
10
 - (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC containerView:(UIView *)containerView;
10
 - (NSArray *)createTransitionsFromVC:(UIViewController *)fromVC toVC:(UIViewController *)toVC containerView:(UIView *)containerView;
11
 
11
 

+ 4
- 4
lib/ios/TransitionDelegate.m View File

2
 #import "DisplayLinkAnimator.h"
2
 #import "DisplayLinkAnimator.h"
3
 
3
 
4
 @implementation TransitionDelegate {
4
 @implementation TransitionDelegate {
5
-    RCTUIManager* _uiManager;
5
+    RCTBridge* _bridge;
6
     id <UIViewControllerContextTransitioning> _transitionContext;
6
     id <UIViewControllerContextTransitioning> _transitionContext;
7
     BOOL _animate;
7
     BOOL _animate;
8
 }
8
 }
9
 
9
 
10
-- (instancetype)initWithUIManager:(RCTUIManager *)uiManager {
10
+- (instancetype)initWithBridge:(RCTBridge *)bridge {
11
     self = [super init];
11
     self = [super init];
12
-    _uiManager = uiManager;
13
-    [_uiManager.observerCoordinator addObserver:self];
12
+    _bridge = bridge;
14
     return self;
13
     return self;
15
 }
14
 }
16
 
15
 
17
 - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
16
 - (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
17
+    [_bridge.uiManager.observerCoordinator addObserver:self];
18
     _animate = YES;
18
     _animate = YES;
19
     _transitionContext = transitionContext;
19
     _transitionContext = transitionContext;
20
     [self prepareTransitionContext:transitionContext];
20
     [self prepareTransitionContext:transitionContext];