Browse Source

Revert "fix overlay options bug"

This reverts commit fc493775eb.
Guy Carmeli 6 years ago
parent
commit
6c451d3744

+ 2
- 11
lib/ios/RNNOverlayManager.m View File

1
 #import "RNNOverlayManager.h"
1
 #import "RNNOverlayManager.h"
2
 #import "RNNErrorHandler.h"
2
 #import "RNNErrorHandler.h"
3
-#import "RNNOverlayWindow.h"
4
 
3
 
5
 @implementation RNNOverlayManager {
4
 @implementation RNNOverlayManager {
6
 	NSMutableDictionary* _overlayDict;
5
 	NSMutableDictionary* _overlayDict;
7
 	RNNStore* _store;
6
 	RNNStore* _store;
8
-	RNNOverlayWindow *_overlayWindow;
9
 }
7
 }
10
 
8
 
11
 - (instancetype)initWithStore:(RNNStore *)store {
9
 - (instancetype)initWithStore:(RNNStore *)store {
19
 
17
 
20
 - (void)showOverlay:(RNNRootViewController *)viewController completion:(RNNTransitionCompletionBlock)completion {
18
 - (void)showOverlay:(RNNRootViewController *)viewController completion:(RNNTransitionCompletionBlock)completion {
21
 	[self cacheOverlay:viewController];
19
 	[self cacheOverlay:viewController];
22
-	_overlayWindow = [[RNNOverlayWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
23
-	[_overlayWindow setWindowLevel:UIWindowLevelNormal];
24
-	[_overlayWindow setRootViewController:viewController];
25
-	[_overlayWindow makeKeyAndVisible];
26
-	
20
+	[[[UIApplication sharedApplication] keyWindow] addSubview:viewController.view];
27
 	completion();
21
 	completion();
28
 }
22
 }
29
 
23
 
44
 }
38
 }
45
 
39
 
46
 - (void)removeCachedOverlay:(RNNRootViewController*)viewController {
40
 - (void)removeCachedOverlay:(RNNRootViewController*)viewController {
47
-	[_overlayWindow setRootViewController:nil];
48
-	[_overlayWindow resignKeyWindow];
49
-	_overlayWindow = nil;
50
-	
41
+	[viewController.view removeFromSuperview];
51
 	[_overlayDict removeObjectForKey:viewController.componentId];
42
 	[_overlayDict removeObjectForKey:viewController.componentId];
52
 	[_store removeComponent:viewController.componentId];
43
 	[_store removeComponent:viewController.componentId];
53
 }
44
 }

+ 0
- 5
lib/ios/RNNOverlayWindow.h View File

1
-#import <UIKit/UIKit.h>
2
-
3
-@interface RNNOverlayWindow : UIWindow
4
-
5
-@end

+ 0
- 15
lib/ios/RNNOverlayWindow.m View File

1
-#import "RNNOverlayWindow.h"
2
-
3
-@implementation RNNOverlayWindow
4
-
5
-- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
6
-	UIView *hitTestResult = [super hitTest:point withEvent:event];
7
-	
8
-	if ([hitTestResult isKindOfClass:[UIWindow class]]) {
9
-		return nil;
10
-	}
11
-	
12
-	return hitTestResult;
13
-}
14
-
15
-@end

+ 0
- 8
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

112
 		507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */; };
112
 		507F44201FFA8A8800D9425B /* RNNRootViewProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */; };
113
 		50887C1520ECC5C200D06111 /* RNNButtonOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50887C1320ECC5C200D06111 /* RNNButtonOptions.h */; };
113
 		50887C1520ECC5C200D06111 /* RNNButtonOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50887C1320ECC5C200D06111 /* RNNButtonOptions.h */; };
114
 		50887C1620ECC5C200D06111 /* RNNButtonOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50887C1420ECC5C200D06111 /* RNNButtonOptions.m */; };
114
 		50887C1620ECC5C200D06111 /* RNNButtonOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50887C1420ECC5C200D06111 /* RNNButtonOptions.m */; };
115
-		50887CA920F26BFE00D06111 /* RNNOverlayWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 50887CA720F26BFD00D06111 /* RNNOverlayWindow.m */; };
116
-		50887CAA20F26BFE00D06111 /* RNNOverlayWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 50887CA820F26BFE00D06111 /* RNNOverlayWindow.h */; };
117
 		50A00C37200F84D6000F01A6 /* RNNOverlayOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A00C35200F84D6000F01A6 /* RNNOverlayOptions.h */; };
115
 		50A00C37200F84D6000F01A6 /* RNNOverlayOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 50A00C35200F84D6000F01A6 /* RNNOverlayOptions.h */; };
118
 		50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */; };
116
 		50A00C38200F84D6000F01A6 /* RNNOverlayOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */; };
119
 		50BE951220B5A787004F5DF5 /* RNNStatusBarOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50BE951020B5A787004F5DF5 /* RNNStatusBarOptions.m */; };
117
 		50BE951220B5A787004F5DF5 /* RNNStatusBarOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 50BE951020B5A787004F5DF5 /* RNNStatusBarOptions.m */; };
334
 		507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNRootViewProtocol.h; sourceTree = "<group>"; };
332
 		507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNRootViewProtocol.h; sourceTree = "<group>"; };
335
 		50887C1320ECC5C200D06111 /* RNNButtonOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNButtonOptions.h; sourceTree = "<group>"; };
333
 		50887C1320ECC5C200D06111 /* RNNButtonOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNButtonOptions.h; sourceTree = "<group>"; };
336
 		50887C1420ECC5C200D06111 /* RNNButtonOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNButtonOptions.m; sourceTree = "<group>"; };
334
 		50887C1420ECC5C200D06111 /* RNNButtonOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNButtonOptions.m; sourceTree = "<group>"; };
337
-		50887CA720F26BFD00D06111 /* RNNOverlayWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayWindow.m; sourceTree = "<group>"; };
338
-		50887CA820F26BFE00D06111 /* RNNOverlayWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNOverlayWindow.h; sourceTree = "<group>"; };
339
 		50A00C35200F84D6000F01A6 /* RNNOverlayOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNOverlayOptions.h; sourceTree = "<group>"; };
335
 		50A00C35200F84D6000F01A6 /* RNNOverlayOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNOverlayOptions.h; sourceTree = "<group>"; };
340
 		50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayOptions.m; sourceTree = "<group>"; };
336
 		50A00C36200F84D6000F01A6 /* RNNOverlayOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNOverlayOptions.m; sourceTree = "<group>"; };
341
 		50BE951020B5A787004F5DF5 /* RNNStatusBarOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNStatusBarOptions.m; sourceTree = "<group>"; };
337
 		50BE951020B5A787004F5DF5 /* RNNStatusBarOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNStatusBarOptions.m; sourceTree = "<group>"; };
671
 				507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */,
667
 				507F441F1FFA8A8800D9425B /* RNNRootViewProtocol.h */,
672
 				E33AC1FF20B5BA0B0090DB8A /* RNNSplitViewController.m */,
668
 				E33AC1FF20B5BA0B0090DB8A /* RNNSplitViewController.m */,
673
 				E33AC20120B5BA550090DB8A /* RNNSplitViewController.h */,
669
 				E33AC20120B5BA550090DB8A /* RNNSplitViewController.h */,
674
-				50887CA820F26BFE00D06111 /* RNNOverlayWindow.h */,
675
-				50887CA720F26BFD00D06111 /* RNNOverlayWindow.m */,
676
 			);
670
 			);
677
 			name = Controllers;
671
 			name = Controllers;
678
 			sourceTree = "<group>";
672
 			sourceTree = "<group>";
884
 				50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */,
878
 				50570B262061473D006A1B5C /* RNNTitleOptions.h in Headers */,
885
 				504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
879
 				504AFE741FFFF0540076E904 /* RNNTopTabsOptions.h in Headers */,
886
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
880
 				E8E5182E1F83A48B000467AC /* RNNTransitionStateHolder.h in Headers */,
887
-				50887CAA20F26BFE00D06111 /* RNNOverlayWindow.h in Headers */,
888
 				507E7D57201DDD3000444E6C /* RNNAnimationOptions.h in Headers */,
881
 				507E7D57201DDD3000444E6C /* RNNAnimationOptions.h in Headers */,
889
 				2DCD9195200014A900EDC75D /* RNNBridgeManager.h in Headers */,
882
 				2DCD9195200014A900EDC75D /* RNNBridgeManager.h in Headers */,
890
 				7B1126A91E2D2B6C00F9B03B /* RNNControllerFactory.h in Headers */,
883
 				7B1126A91E2D2B6C00F9B03B /* RNNControllerFactory.h in Headers */,
1048
 				504AFE651FFE53070076E904 /* RNNOptions.m in Sources */,
1041
 				504AFE651FFE53070076E904 /* RNNOptions.m in Sources */,
1049
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
1042
 				263905BA1E4C6F440023D7D3 /* RCCDrawerController.m in Sources */,
1050
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
1043
 				50F5DFC21F407A8C001A00BC /* RNNTabBarController.m in Sources */,
1051
-				50887CA920F26BFE00D06111 /* RNNOverlayWindow.m in Sources */,
1052
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
1044
 				263905BC1E4C6F440023D7D3 /* RCCDrawerHelper.m in Sources */,
1053
 				4534E72620CB6724009F8185 /* RNNLargeTitleOptions.m in Sources */,
1045
 				4534E72620CB6724009F8185 /* RNNLargeTitleOptions.m in Sources */,
1054
 				507E7D58201DDD3000444E6C /* RNNAnimationOptions.m in Sources */,
1046
 				507E7D58201DDD3000444E6C /* RNNAnimationOptions.m in Sources */,