Daniel Zlotin 8 лет назад
Родитель
Сommit
67d5b8b941

+ 7
- 7
ios/RCCNavigationController.m Просмотреть файл

@@ -200,7 +200,7 @@ NSString const *CALLBACK_ASSOCIATED_ID = @"RCCNavigationController.CALLBACK_ASSO
200 200
     BOOL animatedBool = animated ? [animated boolValue] : YES;
201 201
     
202 202
     NSNumber *setHidden = actionParams[@"hidden"];
203
-    BOOL isHiddenBool = setHidden ? [setHidden boolValue] : NO;
203
+//    BOOL isHiddenBool = setHidden ? [setHidden boolValue] : NO; 
204 204
     
205 205
     RCCViewController *topViewController = ((RCCViewController*)self.topViewController);
206 206
     topViewController.navigatorStyle[@"navBarHidden"] = setHidden;
@@ -213,12 +213,12 @@ NSString const *CALLBACK_ASSOCIATED_ID = @"RCCNavigationController.CALLBACK_ASSO
213 213
 {
214 214
   NSString *callbackId = objc_getAssociatedObject(barButtonItem, &CALLBACK_ASSOCIATED_KEY);
215 215
   if (!callbackId) return;
216
-  NSString *buttonId = objc_getAssociatedObject(barButtonItem, &CALLBACK_ASSOCIATED_ID);
217
-  [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:callbackId body:@
218
-   {
219
-     @"type": @"NavBarButtonPress",
220
-     @"id": buttonId ? buttonId : [NSNull null]
221
-   }];
216
+//  NSString *buttonId = objc_getAssociatedObject(barButtonItem, &CALLBACK_ASSOCIATED_ID);
217
+//  [[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:callbackId body:@
218
+//   {
219
+//     @"type": @"NavBarButtonPress",
220
+//     @"id": buttonId ? buttonId : [NSNull null]
221
+//   }];
222 222
 }
223 223
 
224 224
 -(void)setButtons:(NSArray*)buttons viewController:(UIViewController*)viewController side:(NSString*)side animated:(BOOL)animated

+ 2
- 2
ios/RCCNotification.m Просмотреть файл

@@ -32,7 +32,7 @@
32 32
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"frame" options:0 context:nil];
33 33
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"bounds" options:0 context:NULL];
34 34
         
35
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTReloadNotification object:nil];
35
+//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTReloadNotification object:nil];
36 36
         
37 37
         if ([params[@"dismissWithSwipe"] boolValue])
38 38
         {
@@ -434,7 +434,7 @@ static NSMutableArray *gShownNotificationViews = nil;
434 434
 
435 435
 +(void)dismissWithParams:(NSDictionary*)params resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject
436 436
 {
437
-    int count = [gShownNotificationViews count];
437
+    int count = (int)[gShownNotificationViews count];
438 438
     for (int i = count - 1 ; i >= 0; i--)
439 439
     {
440 440
         NotificationView *notificationView = [gShownNotificationViews objectAtIndex:i];

+ 3
- 9
ios/RNNBridgeModule.m Просмотреть файл

@@ -14,16 +14,10 @@ RCT_EXPORT_MODULE(NativeNavigation);
14 14
 
15 15
 RCT_EXPORT_METHOD(startApp:(NSDictionary*)layout)
16 16
 {
17
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
18
-        
19
-        RCTBridge* bridge = RNNStore.sharedInstance.bridge;
20
-        
21
-        RNNStore.appDelegate.window.rootViewController = [RNNControllerFactory createRootViewController:layout];
22
-        [RNNStore.appDelegate.window makeKeyAndVisible];
23
-    });
24
-    
25
-    
17
+    RCTBridge* bridge = RNNStore.sharedInstance.bridge;
26 18
     
19
+    RNNStore.appDelegate.window.rootViewController = [RNNControllerFactory createRootViewController:layout];
20
+    [RNNStore.appDelegate.window makeKeyAndVisible];
27 21
 }
28 22
 
29 23
 @end

+ 1
- 1
ios/RNNSplashScreen.h Просмотреть файл

@@ -2,6 +2,6 @@
2 2
 
3 3
 @interface RNNSplashScreen : NSObject
4 4
 
5
-+(void)showSplashScreenWhileLoadingJS;
5
++(void)show;
6 6
 
7 7
 @end

+ 1
- 1
ios/RNNSplashScreen.m Просмотреть файл

@@ -4,7 +4,7 @@
4 4
 
5 5
 @implementation RNNSplashScreen
6 6
 
7
-+(void)showSplashScreenWhileLoadingJS
7
++(void)show
8 8
 {
9 9
     CGRect screenBounds = [UIScreen mainScreen].bounds;
10 10
     UIView *splashView = nil;

+ 5
- 8
ios/ReactNativeNavigation.m Просмотреть файл

@@ -3,7 +3,7 @@
3 3
 #import "RNNStore.h"
4 4
 #import "RCTBridge.h"
5 5
 #import "RNNSplashScreen.h"
6
-#import "RCTRootView.h";
6
+#import "RCTRootView.h"
7 7
 
8 8
 @implementation ReactNativeNavigation
9 9
 
@@ -14,15 +14,12 @@
14 14
 
15 15
 +(void)bootstrap:(NSURL *)jsCodeLocation launchOptions:(NSDictionary *)launchOptions
16 16
 {
17
+    RNNStore.appDelegate.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
18
+    RNNStore.appDelegate.window.backgroundColor = [UIColor whiteColor];
17 19
     
18
-        RNNStore.appDelegate.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
19
-        RNNStore.appDelegate.window.backgroundColor = [UIColor whiteColor];
20
-        
21
-        [RNNSplashScreen showSplashScreenWhileLoadingJS];
22
-        
23
-        RNNStore.sharedInstance.bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation moduleProvider:nil launchOptions:launchOptions];
24
-        
20
+    [RNNSplashScreen show];
25 21
     
22
+    RNNStore.sharedInstance.bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation moduleProvider:nil launchOptions:launchOptions];
26 23
 }
27 24
 
28 25
 @end

+ 8
- 6
ios/ReactNativeNavigation.xcodeproj/project.pbxproj Просмотреть файл

@@ -257,18 +257,18 @@
257 257
 		D8AFADB41BEE6F3F00A4592D = {
258 258
 			isa = PBXGroup;
259 259
 			children = (
260
-				7BC9346C1E26886E00EFA125 /* RNNControllerFactory.h */,
261
-				7BC9346D1E26886E00EFA125 /* RNNControllerFactory.m */,
262
-				7BC934691E267BAD00EFA125 /* RNNCommandsHandler.h */,
263
-				7BC9346A1E267BAD00EFA125 /* RNNCommandsHandler.m */,
264 260
 				7BA500731E2544B9001B9E1B /* ReactNativeNavigation.h */,
265 261
 				7BA500741E2544B9001B9E1B /* ReactNativeNavigation.m */,
266 262
 				7BA500761E254908001B9E1B /* RNNSplashScreen.h */,
267 263
 				7BA500771E254908001B9E1B /* RNNSplashScreen.m */,
268
-				7BBFE55F1E253F97002A6182 /* RNNStore.h */,
269
-				7BBFE5601E253F97002A6182 /* RNNStore.m */,
270 264
 				7BBFE5421E25330E002A6182 /* RNNBridgeModule.h */,
271 265
 				7BBFE5431E25330E002A6182 /* RNNBridgeModule.m */,
266
+				7BC9346C1E26886E00EFA125 /* RNNControllerFactory.h */,
267
+				7BC9346D1E26886E00EFA125 /* RNNControllerFactory.m */,
268
+				7BC934691E267BAD00EFA125 /* RNNCommandsHandler.h */,
269
+				7BC9346A1E267BAD00EFA125 /* RNNCommandsHandler.m */,
270
+				7BBFE55F1E253F97002A6182 /* RNNStore.h */,
271
+				7BBFE5601E253F97002A6182 /* RNNStore.m */,
272 272
 				7BBFE53F1E253144002A6182 /* old */,
273 273
 				D8AFADBE1BEE6F3F00A4592D /* Products */,
274 274
 			);
@@ -482,6 +482,7 @@
482 482
 		D8AFADC71BEE6F3F00A4592D /* Debug */ = {
483 483
 			isa = XCBuildConfiguration;
484 484
 			buildSettings = {
485
+				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
485 486
 				HEADER_SEARCH_PATHS = (
486 487
 					"$(inherited)",
487 488
 					"$(SRCROOT)/../../react-native/React/**",
@@ -495,6 +496,7 @@
495 496
 		D8AFADC81BEE6F3F00A4592D /* Release */ = {
496 497
 			isa = XCBuildConfiguration;
497 498
 			buildSettings = {
499
+				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
498 500
 				HEADER_SEARCH_PATHS = (
499 501
 					"$(inherited)",
500 502
 					"$(SRCROOT)/../../react-native/React/**",

+ 3
- 3
package.json Просмотреть файл

@@ -42,8 +42,9 @@
42 42
     "lodash": "4.x.x"
43 43
   },
44 44
   "devDependencies": {
45
-    "react-native": "0.38.0",
46
-    "react": "15.4.1",
45
+    "react-native": "0.40.0",
46
+    "react": "15.4.2",
47
+    "react-test-renderer": "15.4.2",
47 48
     "babel-cli": "6.x.x",
48 49
     "babel-core": "6.x.x",
49 50
     "babel-polyfill": "6.x.x",
@@ -56,7 +57,6 @@
56 57
     "eslint-plugin-react-native": "2.x.x",
57 58
     "jest": "18.x.x",
58 59
     "jest-cli": "18.x.x",
59
-    "react-test-renderer": "15.4.1",
60 60
     "remx": "0.1.x",
61 61
     "semver": "5.x.x",
62 62
     "shell-utils": "1.x.x"