hybrid-navigation 2.7.7 → 2.7.8
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.
- package/CHANGELOG.md +12 -0
- package/ios/HybridNavigation/Bridge/HBDNavigationModule.m +6 -7
- package/ios/HybridNavigation/Navigator/HBDStackNavigator.m +5 -4
- package/ios/HybridNavigation/ViewController/HBDTabBarController.m +3 -2
- package/ios/HybridNavigation/ViewController/UINavigationController+HBD.m +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -182,13 +182,12 @@ RCT_EXPORT_METHOD(findSceneIdByModuleName:
|
|
|
182
182
|
|
|
183
183
|
UIApplication *application = [[UIApplication class] performSelector:@selector(sharedApplication)];
|
|
184
184
|
NSString *sceneId = nil;
|
|
185
|
-
NSUInteger index = application.windows.count - 1;
|
|
186
|
-
|
|
187
185
|
NSString *moduleName = params[@"moduleName"];
|
|
188
186
|
Promise *promise = params[@"promise"];
|
|
189
187
|
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
NSUInteger index = application.windows.count;
|
|
189
|
+
while (index > 0 && sceneId == nil) {
|
|
190
|
+
UIWindow *window = application.windows[index - 1];
|
|
192
191
|
sceneId = [self findSceneIdByModuleName:moduleName withViewController:window.rootViewController];
|
|
193
192
|
index--;
|
|
194
193
|
}
|
|
@@ -216,9 +215,9 @@ RCT_EXPORT_METHOD(findSceneIdByModuleName:
|
|
|
216
215
|
NSArray<UIViewController *> *children = vc.childViewControllers;
|
|
217
216
|
NSUInteger count = children.count;
|
|
218
217
|
if (count > 0) {
|
|
219
|
-
NSUInteger index = count
|
|
220
|
-
while (index >
|
|
221
|
-
UIViewController *child = children[index];
|
|
218
|
+
NSUInteger index = count;
|
|
219
|
+
while (index > 0 && sceneId == nil) {
|
|
220
|
+
UIViewController *child = children[index - 1];
|
|
222
221
|
sceneId = [self findSceneIdByModuleName:moduleName withViewController:child];
|
|
223
222
|
index--;
|
|
224
223
|
}
|
|
@@ -98,12 +98,13 @@
|
|
|
98
98
|
NSUInteger count = children.count;
|
|
99
99
|
NSString *moduleName = extras[@"moduleName"];
|
|
100
100
|
BOOL inclusive = [extras[@"inclusive"] boolValue];
|
|
101
|
-
for (NSUInteger i = count
|
|
102
|
-
|
|
101
|
+
for (NSUInteger i = count; i > 0; i--) {
|
|
102
|
+
NSUInteger index = i - 1;
|
|
103
|
+
HBDViewController *vc = children[index];
|
|
103
104
|
if ([moduleName isEqualToString:vc.moduleName] || [moduleName isEqualToString:vc.sceneId]) {
|
|
104
105
|
viewController = vc;
|
|
105
|
-
if (inclusive && i
|
|
106
|
-
viewController = children[
|
|
106
|
+
if (inclusive && i > 0) {
|
|
107
|
+
viewController = children[index];
|
|
107
108
|
}
|
|
108
109
|
break;
|
|
109
110
|
}
|
|
@@ -105,8 +105,9 @@
|
|
|
105
105
|
|
|
106
106
|
- (void)removeTabBarAboriginal {
|
|
107
107
|
NSUInteger count = self.tabBar.subviews.count;
|
|
108
|
-
for (
|
|
109
|
-
|
|
108
|
+
for (NSUInteger i = count; i > 0; i--) {
|
|
109
|
+
NSUInteger index = i - 1;
|
|
110
|
+
UIView *view = self.tabBar.subviews[index];
|
|
110
111
|
NSString *viewName = [[[view classForCoder] description] stringByReplacingOccurrencesOfString:@"_" withString:@""];
|
|
111
112
|
if ([viewName isEqualToString:@"UITabBarButton"]) {
|
|
112
113
|
[view removeFromSuperview];
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
- (void)redirectToViewController:(UIViewController *)controller target:(UIViewController *)target animated:(BOOL)animated {
|
|
18
18
|
NSMutableArray *children = [self.childViewControllers mutableCopy];
|
|
19
19
|
NSUInteger count = self.childViewControllers.count;
|
|
20
|
-
for (NSUInteger i = count
|
|
21
|
-
|
|
22
|
-
[
|
|
20
|
+
for (NSUInteger i = count; i > 0; i--) {
|
|
21
|
+
NSUInteger index = i - 1;
|
|
22
|
+
UIViewController *child = children[index];
|
|
23
|
+
[children removeObjectAtIndex:index];
|
|
23
24
|
if (child == target) {
|
|
24
25
|
break;
|
|
25
26
|
}
|