Browse Source

ios refactoring

Daniel Zlotin 7 years ago
parent
commit
5fc49c4895

+ 3
- 0
ios/RNN.m View File

@@ -71,7 +71,10 @@
71 71
 -(void)onJavaScriptWillLoad
72 72
 {
73 73
 	self.store = [RNNStore new];
74
+	[self resetRootViewControllerOnlyOnJSDevReload];
75
+}
74 76
 
77
+-(void)resetRootViewControllerOnlyOnJSDevReload {
75 78
 	if(![UIApplication.sharedApplication.delegate.window.rootViewController isKindOfClass:[RNNSplashScreen class]]) {
76 79
 		UIApplication.sharedApplication.delegate.window.rootViewController = nil;
77 80
 	}

+ 0
- 2
ios/RNNReactRootViewCreator.m View File

@@ -14,7 +14,6 @@
14 14
 
15 15
  - (UIView*)createRootView:(NSString*)name rootViewId:(NSString*)rootViewId
16 16
 {
17
-	
18 17
 	if (!rootViewId) {
19 18
 		@throw [NSException exceptionWithName:@"MissingViewId" reason:@"Missing view id" userInfo:nil];
20 19
 	}
@@ -22,7 +21,6 @@
22 21
 	UIView *view = [[RCTRootView alloc] initWithBridge:[RNN instance].bridge
23 22
 										 moduleName:name
24 23
 								  initialProperties:@{@"id": rootViewId}];
25
-	
26 24
 	return view;
27 25
 }
28 26
 

+ 1
- 1
ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

@@ -256,13 +256,13 @@
256 256
 		D8AFADB41BEE6F3F00A4592D = {
257 257
 			isa = PBXGroup;
258 258
 			children = (
259
-				263905881E4C6F440023D7D3 /* RNNSideMenu */,
260 259
 				7BA500731E2544B9001B9E1B /* ReactNativeNavigation.h */,
261 260
 				7BA500741E2544B9001B9E1B /* ReactNativeNavigation.m */,
262 261
 				7BBFE55F1E253F97002A6182 /* RNN.h */,
263 262
 				7BBFE5601E253F97002A6182 /* RNN.m */,
264 263
 				7BD721F31E2D3AA100724059 /* Bridge */,
265 264
 				7B1E4C4B1E2D173700C3A525 /* Controllers */,
265
+				263905881E4C6F440023D7D3 /* RNNSideMenu */,
266 266
 				D8AFADBE1BEE6F3F00A4592D /* Products */,
267 267
 			);
268 268
 			sourceTree = "<group>";

+ 0
- 1
playground/ios/playgroundTests/RNNControllerFactoryTest.m View File

@@ -28,7 +28,6 @@
28 28
 }
29 29
 
30 30
 - (void)tearDown {
31
-	// Put teardown code here. This method is called after the invocation of each test method in the class.
32 31
 	[super tearDown];
33 32
 }
34 33
 

+ 3
- 3
playground/ios/playgroundTests/RNNStoreTest.m View File

@@ -80,15 +80,15 @@
80 80
 	[self setContainerAndRelease:vcId];
81 81
 	
82 82
 	
83
-	XCTAssertNil([self.store findContainerForId:vcId]); // PASS
83
+	XCTAssertNil([self.store findContainerForId:vcId]);
84 84
 }
85 85
 
86
--(void) setContainerAndRelease:(NSString*)vcId {
86
+-(void)setContainerAndRelease:(NSString*)vcId {
87 87
 	@autoreleasepool {
88 88
 		UIViewController *vc2 = [UIViewController new];
89 89
 		[self.store setContainer:vc2 containerId:vcId];
90 90
 		
91
-		XCTAssertNotNil([self.store findContainerForId:vcId]); // PASS
91
+		XCTAssertNotNil([self.store findContainerForId:vcId]);
92 92
 	}
93 93
 }
94 94