react-native-navigation的迁移库

RCCViewController.m 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. #import "RCCViewController.h"
  2. #import "RCCNavigationController.h"
  3. #import "RCCTabBarController.h"
  4. #import "RCCDrawerController.h"
  5. #import "RCCTheSideBarManagerViewController.h"
  6. #import "RCTRootView.h"
  7. #import "RCCManager.h"
  8. #import "RCTConvert.h"
  9. #import "RCCExternalViewControllerProtocol.h"
  10. NSString* const RCCViewControllerCancelReactTouchesNotification = @"RCCViewControllerCancelReactTouchesNotification";
  11. const NSInteger BLUR_STATUS_TAG = 78264801;
  12. const NSInteger BLUR_NAVBAR_TAG = 78264802;
  13. const NSInteger TRANSPARENT_NAVBAR_TAG = 78264803;
  14. @interface RCCViewController() <UIGestureRecognizerDelegate>
  15. @property (nonatomic) BOOL _hidesBottomBarWhenPushed;
  16. @property (nonatomic) BOOL _statusBarHideWithNavBar;
  17. @property (nonatomic) BOOL _statusBarHidden;
  18. @property (nonatomic) BOOL _statusBarTextColorSchemeLight;
  19. @property (nonatomic, strong) NSDictionary *originalNavBarImages;
  20. @property (nonatomic, strong) UIImageView *navBarHairlineImageView;
  21. @property (nonatomic, weak) id <UIGestureRecognizerDelegate> originalInteractivePopGestureDelegate;
  22. @end
  23. @implementation RCCViewController
  24. -(UIImageView *)navBarHairlineImageView {
  25. if (!_navBarHairlineImageView) {
  26. _navBarHairlineImageView = [self findHairlineImageViewUnder:self.navigationController.navigationBar];
  27. }
  28. return _navBarHairlineImageView;
  29. }
  30. + (UIViewController*)controllerWithLayout:(NSDictionary *)layout globalProps:(NSDictionary *)globalProps bridge:(RCTBridge *)bridge
  31. {
  32. UIViewController* controller = nil;
  33. if (!layout) return nil;
  34. // get props
  35. if (!layout[@"props"]) return nil;
  36. if (![layout[@"props"] isKindOfClass:[NSDictionary class]]) return nil;
  37. NSDictionary *props = layout[@"props"];
  38. // get children
  39. if (!layout[@"children"]) return nil;
  40. if (![layout[@"children"] isKindOfClass:[NSArray class]]) return nil;
  41. NSArray *children = layout[@"children"];
  42. // create according to type
  43. NSString *type = layout[@"type"];
  44. if (!type) return nil;
  45. // regular view controller
  46. if ([type isEqualToString:@"ViewControllerIOS"])
  47. {
  48. controller = [[RCCViewController alloc] initWithProps:props children:children globalProps:globalProps bridge:bridge];
  49. }
  50. // navigation controller
  51. if ([type isEqualToString:@"NavigationControllerIOS"])
  52. {
  53. controller = [[RCCNavigationController alloc] initWithProps:props children:children globalProps:globalProps bridge:bridge];
  54. }
  55. // tab bar controller
  56. if ([type isEqualToString:@"TabBarControllerIOS"])
  57. {
  58. controller = [[RCCTabBarController alloc] initWithProps:props children:children globalProps:globalProps bridge:bridge];
  59. }
  60. // side menu controller
  61. if ([type isEqualToString:@"DrawerControllerIOS"])
  62. {
  63. NSString *drawerType = props[@"type"];
  64. if ([drawerType isEqualToString:@"TheSideBar"]) {
  65. controller = [[RCCTheSideBarManagerViewController alloc] initWithProps:props children:children globalProps:globalProps bridge:bridge];
  66. }
  67. else {
  68. controller = [[RCCDrawerController alloc] initWithProps:props children:children globalProps:globalProps bridge:bridge];
  69. }
  70. }
  71. // register the controller if we have an id
  72. NSString *componentId = props[@"id"];
  73. if (controller && componentId)
  74. {
  75. [[RCCManager sharedInstance] registerController:controller componentId:componentId componentType:type];
  76. }
  77. return controller;
  78. }
  79. - (instancetype)initWithProps:(NSDictionary *)props children:(NSArray *)children globalProps:(NSDictionary *)globalProps bridge:(RCTBridge *)bridge
  80. {
  81. NSString *component = props[@"component"];
  82. if (!component) return nil;
  83. NSDictionary *passProps = props[@"passProps"];
  84. NSDictionary *navigatorStyle = props[@"style"];
  85. NSMutableDictionary *mergedProps = [NSMutableDictionary dictionaryWithDictionary:globalProps];
  86. [mergedProps addEntriesFromDictionary:passProps];
  87. RCTRootView *reactView = [[RCTRootView alloc] initWithBridge:bridge moduleName:component initialProperties:mergedProps];
  88. if (!reactView) return nil;
  89. self = [super init];
  90. if (!self) return nil;
  91. [self commonInit:reactView navigatorStyle:navigatorStyle props:props];
  92. return self;
  93. }
  94. - (instancetype)initWithComponent:(NSString *)component passProps:(NSDictionary *)passProps navigatorStyle:(NSDictionary*)navigatorStyle globalProps:(NSDictionary *)globalProps bridge:(RCTBridge *)bridge
  95. {
  96. NSMutableDictionary *mergedProps = [NSMutableDictionary dictionaryWithDictionary:globalProps];
  97. [mergedProps addEntriesFromDictionary:passProps];
  98. RCTRootView *reactView = [[RCTRootView alloc] initWithBridge:bridge moduleName:component initialProperties:mergedProps];
  99. if (!reactView) return nil;
  100. self = [super init];
  101. if (!self) return nil;
  102. [self commonInit:reactView navigatorStyle:navigatorStyle props:passProps];
  103. return self;
  104. }
  105. - (void)commonInit:(RCTRootView*)reactView navigatorStyle:(NSDictionary*)navigatorStyle props:(NSDictionary*)props
  106. {
  107. self.view = reactView;
  108. self.edgesForExtendedLayout = UIRectEdgeNone; // default
  109. self.automaticallyAdjustsScrollViewInsets = NO; // default
  110. self.navigatorStyle = [NSMutableDictionary dictionaryWithDictionary:navigatorStyle];
  111. [self setStyleOnInit];
  112. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRNReload) name:RCTReloadNotification object:nil];
  113. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCancelReactTouches) name:RCCViewControllerCancelReactTouchesNotification object:nil];
  114. // In order to support 3rd party native ViewControllers, we support passing a class name as a prop mamed `ExternalNativeScreenClass`
  115. // In this case, we create an instance and add it as a child ViewController which preserves the VC lifecycle.
  116. // In case some props are necessary in the native ViewController, the ExternalNativeScreenProps can be used to pass them
  117. [self addExternalVCIfNecessary:props];
  118. }
  119. - (void)dealloc
  120. {
  121. [[NSNotificationCenter defaultCenter] removeObserver:self];
  122. self.view = nil;
  123. }
  124. -(void)onRNReload
  125. {
  126. [[NSNotificationCenter defaultCenter] removeObserver:self];
  127. self.view = nil;
  128. }
  129. -(void)onCancelReactTouches
  130. {
  131. if ([self.view isKindOfClass:[RCTRootView class]]){
  132. [(RCTRootView*)self.view cancelTouches];
  133. }
  134. }
  135. - (void)viewWillAppear:(BOOL)animated
  136. {
  137. [super viewWillAppear:animated];
  138. [self setStyleOnAppear];
  139. }
  140. - (void)viewWillDisappear:(BOOL)animated
  141. {
  142. [super viewWillDisappear:animated];
  143. [self setStyleOnDisappear];
  144. }
  145. // most styles should be set here since when we pop a view controller that changed them
  146. // we want to reset the style to what we expect (so we need to reset on every willAppear)
  147. - (void)setStyleOnAppear
  148. {
  149. [self setStyleOnAppearForViewController:self];
  150. }
  151. -(void)setStyleOnAppearForViewController:(UIViewController*)viewController
  152. {
  153. NSString *navBarBackgroundColor = self.navigatorStyle[@"navBarBackgroundColor"];
  154. if (navBarBackgroundColor)
  155. {
  156. UIColor *color = navBarBackgroundColor != (id)[NSNull null] ? [RCTConvert UIColor:navBarBackgroundColor] : nil;
  157. viewController.navigationController.navigationBar.barTintColor = color;
  158. }
  159. else
  160. {
  161. viewController.navigationController.navigationBar.barTintColor = nil;
  162. }
  163. NSString *navBarTextColor = self.navigatorStyle[@"navBarTextColor"];
  164. if (navBarTextColor)
  165. {
  166. UIColor *color = navBarTextColor != (id)[NSNull null] ? [RCTConvert UIColor:navBarTextColor] : nil;
  167. [viewController.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : color}];
  168. }
  169. else
  170. {
  171. [viewController.navigationController.navigationBar setTitleTextAttributes:nil];
  172. }
  173. NSString *navBarButtonColor = self.navigatorStyle[@"navBarButtonColor"];
  174. if (navBarButtonColor)
  175. {
  176. UIColor *color = navBarButtonColor != (id)[NSNull null] ? [RCTConvert UIColor:navBarButtonColor] : nil;
  177. viewController.navigationController.navigationBar.tintColor = color;
  178. }
  179. else
  180. {
  181. viewController.navigationController.navigationBar.tintColor = nil;
  182. }
  183. NSString *statusBarTextColorScheme = self.navigatorStyle[@"statusBarTextColorScheme"];
  184. if (statusBarTextColorScheme && [statusBarTextColorScheme isEqualToString:@"light"])
  185. {
  186. viewController.navigationController.navigationBar.barStyle = UIBarStyleBlack;
  187. self._statusBarTextColorSchemeLight = YES;
  188. }
  189. else
  190. {
  191. viewController.navigationController.navigationBar.barStyle = UIBarStyleDefault;
  192. self._statusBarTextColorSchemeLight = NO;
  193. }
  194. NSNumber *navBarHidden = self.navigatorStyle[@"navBarHidden"];
  195. BOOL navBarHiddenBool = navBarHidden ? [navBarHidden boolValue] : NO;
  196. if (viewController.navigationController.navigationBarHidden != navBarHiddenBool)
  197. {
  198. [viewController.navigationController setNavigationBarHidden:navBarHiddenBool animated:YES];
  199. }
  200. NSNumber *navBarHideOnScroll = self.navigatorStyle[@"navBarHideOnScroll"];
  201. BOOL navBarHideOnScrollBool = navBarHideOnScroll ? [navBarHideOnScroll boolValue] : NO;
  202. if (navBarHideOnScrollBool)
  203. {
  204. viewController.navigationController.hidesBarsOnSwipe = YES;
  205. }
  206. else
  207. {
  208. viewController.navigationController.hidesBarsOnSwipe = NO;
  209. }
  210. NSNumber *statusBarBlur = self.navigatorStyle[@"statusBarBlur"];
  211. BOOL statusBarBlurBool = statusBarBlur ? [statusBarBlur boolValue] : NO;
  212. if (statusBarBlurBool)
  213. {
  214. if (![viewController.view viewWithTag:BLUR_STATUS_TAG])
  215. {
  216. UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
  217. blur.frame = [[UIApplication sharedApplication] statusBarFrame];
  218. blur.tag = BLUR_STATUS_TAG;
  219. [viewController.view addSubview:blur];
  220. }
  221. }
  222. NSNumber *navBarBlur = self.navigatorStyle[@"navBarBlur"];
  223. BOOL navBarBlurBool = navBarBlur ? [navBarBlur boolValue] : NO;
  224. if (navBarBlurBool)
  225. {
  226. if (![viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG])
  227. {
  228. [self storeOriginalNavBarImages];
  229. [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
  230. self.navigationController.navigationBar.shadowImage = [UIImage new];
  231. UIVisualEffectView *blur = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
  232. CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
  233. blur.frame = CGRectMake(0, -1 * statusBarFrame.size.height, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height + statusBarFrame.size.height);
  234. blur.userInteractionEnabled = NO;
  235. blur.tag = BLUR_NAVBAR_TAG;
  236. [self.navigationController.navigationBar insertSubview:blur atIndex:0];
  237. }
  238. }
  239. else
  240. {
  241. UIView *blur = [viewController.navigationController.navigationBar viewWithTag:BLUR_NAVBAR_TAG];
  242. if (blur)
  243. {
  244. [blur removeFromSuperview];
  245. [viewController.navigationController.navigationBar setBackgroundImage:self.originalNavBarImages[@"bgImage"] forBarMetrics:UIBarMetricsDefault];
  246. viewController.navigationController.navigationBar.shadowImage = self.originalNavBarImages[@"shadowImage"];
  247. self.originalNavBarImages = nil;
  248. }
  249. }
  250. NSNumber *navBarTransparent = self.navigatorStyle[@"navBarTransparent"];
  251. BOOL navBarTransparentBool = navBarTransparent ? [navBarTransparent boolValue] : NO;
  252. if (navBarTransparentBool)
  253. {
  254. if (![viewController.navigationController.navigationBar viewWithTag:TRANSPARENT_NAVBAR_TAG])
  255. {
  256. [self storeOriginalNavBarImages];
  257. [viewController.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
  258. viewController.navigationController.navigationBar.shadowImage = [UIImage new];
  259. UIView *transparentView = [[UIView alloc] initWithFrame:CGRectZero];
  260. transparentView.tag = TRANSPARENT_NAVBAR_TAG;
  261. [viewController.navigationController.navigationBar insertSubview:transparentView atIndex:0];
  262. }
  263. }
  264. else
  265. {
  266. UIView *transparentView = [viewController.navigationController.navigationBar viewWithTag:TRANSPARENT_NAVBAR_TAG];
  267. if (transparentView)
  268. {
  269. [transparentView removeFromSuperview];
  270. [viewController.navigationController.navigationBar setBackgroundImage:self.originalNavBarImages[@"bgImage"] forBarMetrics:UIBarMetricsDefault];
  271. viewController.navigationController.navigationBar.shadowImage = self.originalNavBarImages[@"shadowImage"];
  272. self.originalNavBarImages = nil;
  273. }
  274. }
  275. NSNumber *navBarTranslucent = self.navigatorStyle[@"navBarTranslucent"];
  276. BOOL navBarTranslucentBool = navBarTranslucent ? [navBarTranslucent boolValue] : NO;
  277. if (navBarTranslucentBool || navBarBlurBool)
  278. {
  279. viewController.navigationController.navigationBar.translucent = YES;
  280. }
  281. else
  282. {
  283. viewController.navigationController.navigationBar.translucent = NO;
  284. }
  285. NSNumber *drawUnderNavBar = self.navigatorStyle[@"drawUnderNavBar"];
  286. BOOL drawUnderNavBarBool = drawUnderNavBar ? [drawUnderNavBar boolValue] : NO;
  287. if (drawUnderNavBarBool)
  288. {
  289. viewController.edgesForExtendedLayout |= UIRectEdgeTop;
  290. }
  291. else
  292. {
  293. viewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
  294. }
  295. NSNumber *drawUnderTabBar = self.navigatorStyle[@"drawUnderTabBar"];
  296. BOOL drawUnderTabBarBool = drawUnderTabBar ? [drawUnderTabBar boolValue] : NO;
  297. if (drawUnderTabBarBool)
  298. {
  299. viewController.edgesForExtendedLayout |= UIRectEdgeBottom;
  300. }
  301. else
  302. {
  303. viewController.edgesForExtendedLayout &= ~UIRectEdgeBottom;
  304. }
  305. NSNumber *removeNavBarBorder = self.navigatorStyle[@"navBarNoBorder"];
  306. BOOL removeNavBarBorderBool = removeNavBarBorder ? [removeNavBarBorder boolValue] : NO;
  307. if(removeNavBarBorderBool)
  308. {
  309. self.navBarHairlineImageView.hidden = YES;
  310. }
  311. else
  312. {
  313. self.navBarHairlineImageView.hidden = NO;
  314. }
  315. //Bug fix: in case there is a interactivePopGestureRecognizer, it prevents react-native from getting touch events on the left screen area that the gesture handles
  316. //overriding the delegate of the gesture prevents this from happening while keeping the gesture intact (another option was to disable it completely by demand)
  317. self.originalInteractivePopGestureDelegate = nil;
  318. if (self.navigationController != nil && self.navigationController.interactivePopGestureRecognizer != nil)
  319. {
  320. id <UIGestureRecognizerDelegate> interactivePopGestureRecognizer = self.navigationController.interactivePopGestureRecognizer.delegate;
  321. if (interactivePopGestureRecognizer != nil)
  322. {
  323. self.originalInteractivePopGestureDelegate = interactivePopGestureRecognizer;
  324. self.navigationController.interactivePopGestureRecognizer.delegate = self;
  325. }
  326. }
  327. }
  328. -(void)storeOriginalNavBarImages {
  329. NSMutableDictionary *originalNavBarImages = [@{} mutableCopy];
  330. UIImage *bgImage = [self.navigationController.navigationBar backgroundImageForBarMetrics:UIBarMetricsDefault];
  331. if (bgImage != nil)
  332. {
  333. originalNavBarImages[@"bgImage"] = bgImage;
  334. }
  335. UIImage *shadowImage = self.navigationController.navigationBar.shadowImage;
  336. if (shadowImage != nil)
  337. {
  338. originalNavBarImages[@"shadowImage"] = shadowImage;
  339. }
  340. self.originalNavBarImages = originalNavBarImages;
  341. }
  342. -(void)setStyleOnDisappear
  343. {
  344. self.navBarHairlineImageView.hidden = NO;
  345. if (self.navigationController != nil && self.navigationController.interactivePopGestureRecognizer != nil && self.originalInteractivePopGestureDelegate != nil)
  346. {
  347. self.navigationController.interactivePopGestureRecognizer.delegate = self.originalInteractivePopGestureDelegate;
  348. self.originalInteractivePopGestureDelegate = nil;
  349. }
  350. }
  351. // only styles that can't be set on willAppear should be set here
  352. - (void)setStyleOnInit
  353. {
  354. NSNumber *tabBarHidden = self.navigatorStyle[@"tabBarHidden"];
  355. BOOL tabBarHiddenBool = tabBarHidden ? [tabBarHidden boolValue] : NO;
  356. if (tabBarHiddenBool)
  357. {
  358. self._hidesBottomBarWhenPushed = YES;
  359. }
  360. else
  361. {
  362. self._hidesBottomBarWhenPushed = NO;
  363. }
  364. NSNumber *statusBarHideWithNavBar = self.navigatorStyle[@"statusBarHideWithNavBar"];
  365. BOOL statusBarHideWithNavBarBool = statusBarHideWithNavBar ? [statusBarHideWithNavBar boolValue] : NO;
  366. if (statusBarHideWithNavBarBool)
  367. {
  368. self._statusBarHideWithNavBar = YES;
  369. }
  370. else
  371. {
  372. self._statusBarHideWithNavBar = NO;
  373. }
  374. NSNumber *statusBarHidden = self.navigatorStyle[@"statusBarHidden"];
  375. BOOL statusBarHiddenBool = statusBarHidden ? [statusBarHidden boolValue] : NO;
  376. if (statusBarHiddenBool)
  377. {
  378. self._statusBarHidden = YES;
  379. }
  380. else
  381. {
  382. self._statusBarHidden = NO;
  383. }
  384. }
  385. - (BOOL)hidesBottomBarWhenPushed
  386. {
  387. if (!self._hidesBottomBarWhenPushed) return NO;
  388. return (self.navigationController.topViewController == self);
  389. }
  390. - (BOOL)prefersStatusBarHidden
  391. {
  392. if (self._statusBarHidden)
  393. {
  394. return YES;
  395. }
  396. if (self._statusBarHideWithNavBar)
  397. {
  398. return self.navigationController.isNavigationBarHidden;
  399. }
  400. else
  401. {
  402. return NO;
  403. }
  404. }
  405. - (void)setNavBarVisibilityChange:(BOOL)animated {
  406. [self.navigationController setNavigationBarHidden:[self.navigatorStyle[@"navBarHidden"] boolValue] animated:animated];
  407. }
  408. - (UIStatusBarStyle)preferredStatusBarStyle
  409. {
  410. if (self._statusBarTextColorSchemeLight)
  411. {
  412. return UIStatusBarStyleLightContent;
  413. }
  414. else
  415. {
  416. return UIStatusBarStyleDefault;
  417. }
  418. }
  419. - (UIImageView *)findHairlineImageViewUnder:(UIView *)view {
  420. if ([view isKindOfClass:UIImageView.class] && view.bounds.size.height <= 1.0) {
  421. return (UIImageView *)view;
  422. }
  423. for (UIView *subview in view.subviews) {
  424. UIImageView *imageView = [self findHairlineImageViewUnder:subview];
  425. if (imageView) {
  426. return imageView;
  427. }
  428. }
  429. return nil;
  430. }
  431. -(void)addExternalVCIfNecessary:(NSDictionary*)props
  432. {
  433. NSString *externalScreenClass = props[@"externalNativeScreenClass"];
  434. if (externalScreenClass != nil)
  435. {
  436. Class class = NSClassFromString(externalScreenClass);
  437. if (class != NULL)
  438. {
  439. id obj = [[class alloc] init];
  440. if (obj != nil && [obj isKindOfClass:[UIViewController class]] && [obj conformsToProtocol:@protocol(RCCExternalViewControllerProtocol)])
  441. {
  442. ((id <RCCExternalViewControllerProtocol>)obj).controllerDelegate = self;
  443. [obj setProps:props[@"externalNativeScreenProps"]];
  444. UIViewController *viewController = (UIViewController*)obj;
  445. [self addChildViewController:viewController];
  446. viewController.view.frame = self.view.bounds;
  447. [self.view addSubview:viewController.view];
  448. [viewController didMoveToParentViewController:self];
  449. }
  450. else
  451. {
  452. NSLog(@"addExternalVCIfNecessary: could not create instance. Make sure that your class is a UIViewController whihc confirms to RCCExternalViewControllerProtocol");
  453. }
  454. }
  455. else
  456. {
  457. NSLog(@"addExternalVCIfNecessary: could not create class from string. Check that the proper class name wass passed in ExternalNativeScreenClass");
  458. }
  459. }
  460. }
  461. #pragma mark - NewRelic
  462. - (NSString*) customNewRelicInteractionName
  463. {
  464. NSString *interactionName = nil;
  465. if (self.view != nil && [self.view isKindOfClass:[RCTRootView class]])
  466. {
  467. NSString *moduleName = ((RCTRootView*)self.view).moduleName;
  468. if(moduleName != nil)
  469. {
  470. interactionName = [NSString stringWithFormat:@"RCCViewController: %@", moduleName];
  471. }
  472. }
  473. if (interactionName == nil)
  474. {
  475. interactionName = [NSString stringWithFormat:@"RCCViewController with title: %@", self.title];
  476. }
  477. return interactionName;
  478. }
  479. @end