hybrid-navigation 2.17.11 → 2.17.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,11 +83,6 @@
83
83
  }
84
84
 
85
85
  - (void)handleNavigationWithViewController:(UIViewController *)vc action:(NSString *)action extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
86
- if (!vc.hbd_inViewHierarchy) {
87
- callback(@[NSNull.null, @NO]);
88
- return;
89
- }
90
-
91
86
  HBDDrawerController *drawer = [vc drawerController];
92
87
  if (!drawer) {
93
88
  callback(@[NSNull.null, @NO]);
@@ -50,11 +50,6 @@
50
50
  }
51
51
 
52
52
  - (void)handleNavigationWithViewController:(UIViewController *)vc action:(NSString *)action extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
53
- if (!vc.hbd_inViewHierarchy) {
54
- callback(@[NSNull.null, @NO]);
55
- return;
56
- }
57
-
58
53
  if ([action isEqualToString:@"present"]) {
59
54
  [self handlePresentWithViewController:vc extras:extras callback:callback];
60
55
  return;
@@ -66,12 +66,6 @@
66
66
  return;
67
67
  }
68
68
 
69
- if (![nav.childViewControllers containsObject:vc]) {
70
- RCTLogInfo(@"[Navigation] 找不到对应的 action target %@", extras[@"from"]);
71
- callback(@[NSNull.null, @NO]);
72
- return;
73
- }
74
-
75
69
  if (nav.transitionCoordinator) {
76
70
  RCTLogInfo(@"[Navigation] 等待上个 action 执行完成 from:%@ %@ to:%@", extras[@"from"], action, extras[@"to"]);
77
71
  [nav.transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
@@ -175,11 +175,6 @@
175
175
  }
176
176
 
177
177
  - (void)handleNavigationWithViewController:(UIViewController *)vc action:(NSString *)action extras:(NSDictionary *)extras callback:(RCTResponseSenderBlock)callback {
178
- if (!vc.hbd_inViewHierarchy) {
179
- callback(@[NSNull.null, @NO]);
180
- return;
181
- }
182
-
183
178
  UITabBarController *tabBarController = [self tabBarControllerForViewController:vc];
184
179
 
185
180
  if (!tabBarController) {
@@ -22,7 +22,7 @@
22
22
 
23
23
  - (void)dealloc {
24
24
  [[NSNotificationCenter defaultCenter] removeObserver:self name:RCTBridgeWillReloadNotification object:nil];
25
- RCTLogInfo(@"销毁页面 %@", self.moduleName);
25
+ RCTLogInfo(@"[Navigation] 销毁页面 %@", self.moduleName);
26
26
  }
27
27
 
28
28
  - (instancetype)initWithModuleName:(NSString *)moduleName props:(NSDictionary *)props options:(NSDictionary *)options {
@@ -48,7 +48,7 @@
48
48
  self.view = [[HBDRootView alloc] initWithRootView:rootView];
49
49
  [self.view addSubview:rootView];
50
50
  [self updateReactViewConstraints];
51
- RCTLogInfo(@"加载页面 %@", self.moduleName);
51
+ RCTLogInfo(@"[Navigation] 加载页面 %@", self.moduleName);
52
52
  }
53
53
 
54
54
  - (void)viewDidLoad {
@@ -16,8 +16,6 @@
16
16
  @property(nonatomic, assign, readonly) float hbd_barShadowAlpha;
17
17
  @property(nonatomic, assign) BOOL hbd_statusBarHidden;
18
18
 
19
- @property(nonatomic, assign) BOOL hbd_inViewHierarchy;
20
-
21
19
  - (void)hbd_setNeedsUpdateNavigationBar;
22
20
 
23
21
  @property(nonatomic, copy, readonly) NSString *sceneId;
@@ -15,15 +15,9 @@
15
15
  Class clazz = [self class];
16
16
  hbd_exchangeImplementations(clazz, @selector(presentViewController:animated:completion:), @selector(hbd_presentViewController:animated:completion:));
17
17
  hbd_exchangeImplementations(clazz, @selector(dismissViewControllerAnimated:completion:), @selector(hbd_dismissViewControllerAnimated:completion:));
18
- hbd_exchangeImplementations(clazz, @selector(didMoveToParentViewController:), @selector(hbd_didMoveToParentViewController:));
19
18
  });
20
19
  }
21
20
 
22
- - (void)hbd_didMoveToParentViewController:(UIViewController *)parent {
23
- [self hbd_didMoveToParentViewController:parent];
24
- self.hbd_inViewHierarchy = parent != nil;
25
- }
26
-
27
21
  - (void)hbd_presentViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(void (^)(void))completion {
28
22
  if (![self canPresentViewController]) {
29
23
  [self didReceiveResultCode:0 resultData:nil requestCode:viewController.requestCode];
@@ -246,16 +240,6 @@
246
240
  objc_setAssociatedObject(self, @selector(hbd_swipeBackEnabled), @(enabled), OBJC_ASSOCIATION_COPY_NONATOMIC);
247
241
  }
248
242
 
249
-
250
- - (BOOL)hbd_inViewHierarchy {
251
- id obj = objc_getAssociatedObject(self, _cmd);
252
- return obj ? [obj boolValue] : YES;
253
- }
254
-
255
- - (void)setHbd_inViewHierarchy:(BOOL)inViewHierarchy {
256
- objc_setAssociatedObject(self, @selector(hbd_inViewHierarchy), @(inViewHierarchy), OBJC_ASSOCIATION_COPY_NONATOMIC);
257
- }
258
-
259
243
  - (void)hbd_setNeedsUpdateNavigationBar {
260
244
  if (self.navigationController && [self.navigationController isKindOfClass:[HBDNavigationController class]]) {
261
245
  HBDNavigationController *nav = (HBDNavigationController *) self.navigationController;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hybrid-navigation",
3
3
  "description": "React Native Navigation that supports seamless navigation between Native and React.",
4
- "version": "2.17.11",
4
+ "version": "2.17.12",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",