|
@@ -29,6 +29,8 @@
|
29
|
29
|
|
30
|
30
|
if (tabBarController.selectedIndex != [tabBarController.viewControllers indexOfObject:viewController]) {
|
31
|
31
|
[RCCTabBarController sendScreenTabChangedEvent:viewController];
|
|
32
|
+ } else {
|
|
33
|
+ [RCCTabBarController sendScreenTabPressedEvent:viewController];
|
32
|
34
|
}
|
33
|
35
|
|
34
|
36
|
return YES;
|
|
@@ -257,6 +259,14 @@
|
257
|
259
|
}
|
258
|
260
|
|
259
|
261
|
+(void)sendScreenTabChangedEvent:(UIViewController*)viewController {
|
|
262
|
+ [RCCTabBarController sendTabEvent:@"bottomTabSelected" controller:viewController];
|
|
263
|
+}
|
|
264
|
+
|
|
265
|
++(void)sendScreenTabPressedEvent:(UIViewController*)viewController {
|
|
266
|
+ [RCCTabBarController sendTabEvent:@"bottomTabReselected" controller:viewController];
|
|
267
|
+}
|
|
268
|
+
|
|
269
|
++(void)sendTabEvent:(NSString *)event controller:(UIViewController*)viewController {
|
260
|
270
|
if ([viewController.view isKindOfClass:[RCTRootView class]]){
|
261
|
271
|
RCTRootView *rootView = (RCTRootView *)viewController.view;
|
262
|
272
|
|
|
@@ -266,7 +276,7 @@
|
266
|
276
|
|
267
|
277
|
[[[RCCManager sharedInstance] getBridge].eventDispatcher sendAppEventWithName:rootView.appProperties[@"navigatorEventID"] body:@
|
268
|
278
|
{
|
269
|
|
- @"id": @"bottomTabSelected",
|
|
279
|
+ @"id": event,
|
270
|
280
|
@"navigatorID": navigatorID,
|
271
|
281
|
@"screenInstanceID": screenInstanceID
|
272
|
282
|
}];
|
|
@@ -276,9 +286,8 @@
|
276
|
286
|
if ([viewController isKindOfClass:[UINavigationController class]]) {
|
277
|
287
|
UINavigationController *navigationController = (UINavigationController*)viewController;
|
278
|
288
|
UIViewController *topViewController = [navigationController topViewController];
|
279
|
|
- [RCCTabBarController sendScreenTabChangedEvent:topViewController];
|
|
289
|
+ [RCCTabBarController sendTabEvent:event controller:topViewController];
|
280
|
290
|
}
|
281
|
291
|
}
|
282
|
292
|
|
283
|
|
-
|
284
|
293
|
@end
|