Browse Source

Switch to RCTJavaScriptWillStartLoadingNotification (#803)

fixes #800 #797
Guy Carmeli 7 years ago
parent
commit
687b80ba55
3 changed files with 3 additions and 3 deletions
  1. 1
    1
      ios/RCCLightBox.m
  2. 1
    1
      ios/RCCNotification.m
  3. 1
    1
      ios/RCCViewController.m

+ 1
- 1
ios/RCCLightBox.m View File

65
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"frame" options:0 context:nil];
65
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"frame" options:0 context:nil];
66
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"bounds" options:0 context:NULL];
66
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"bounds" options:0 context:NULL];
67
         
67
         
68
-//        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTReloadNotification object:nil];
68
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTJavaScriptWillStartLoadingNotification object:nil];
69
     }
69
     }
70
     return self;
70
     return self;
71
 }
71
 }

+ 1
- 1
ios/RCCNotification.m View File

32
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"frame" options:0 context:nil];
32
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"frame" options:0 context:nil];
33
         [self.reactView.contentView.layer addObserver:self forKeyPath:@"bounds" options:0 context:NULL];
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:RCTJavaScriptWillStartLoadingNotification object:nil];
36
         
36
         
37
         if ([params[@"dismissWithSwipe"] boolValue])
37
         if ([params[@"dismissWithSwipe"] boolValue])
38
         {
38
         {

+ 1
- 1
ios/RCCViewController.m View File

145
     
145
     
146
     [self setStyleOnInit];
146
     [self setStyleOnInit];
147
     
147
     
148
-//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTReloadNotification object:nil];
148
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTJavaScriptWillStartLoadingNotification object:nil];
149
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCancelReactTouches) name:RCCViewControllerCancelReactTouchesNotification object:nil];
149
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCancelReactTouches) name:RCCViewControllerCancelReactTouchesNotification object:nil];
150
     
150
     
151
     // In order to support 3rd party native ViewControllers, we support passing a class name as a prop mamed `ExternalNativeScreenClass`
151
     // In order to support 3rd party native ViewControllers, we support passing a class name as a prop mamed `ExternalNativeScreenClass`