react-native-navigation的迁移库

CommandsHandlerCreator.m 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #import "CommandsHandlerCreator.h"
  2. #import "RNNTestRootViewCreator.h"
  3. #import <ReactNativeNavigation/RNNEventEmitter.h>
  4. #import <ReactNativeNavigation/RNNOverlayManager.h>
  5. #import <ReactNativeNavigation/RNNModalManager.h>
  6. #import <ReactNativeNavigation/RNNControllerFactory.h>
  7. @implementation CommandsHandlerCreator
  8. + (RNNCommandsHandler *)createWithWindow:(UIWindow *)window {
  9. RNNTestRootViewCreator* creator = [RNNTestRootViewCreator new];
  10. RNNEventEmitter* eventEmmiter = [RNNEventEmitter new];
  11. RNNOverlayManager* overlayManager = [RNNOverlayManager new];
  12. RNNModalManager* modalManager = [RNNModalManager new];
  13. RNNControllerFactory* controllerFactory = [[RNNControllerFactory alloc] initWithRootViewCreator:creator eventEmitter:eventEmmiter store:nil componentRegistry:nil andBridge:nil bottomTabsAttachModeFactory:[BottomTabsAttachModeFactory new]];
  14. RNNCommandsHandler* commandsHandler = [[RNNCommandsHandler alloc] initWithControllerFactory:controllerFactory eventEmitter:eventEmmiter modalManager:modalManager overlayManager:overlayManager mainWindow:window];
  15. [commandsHandler setReadyToReceiveCommands:YES];
  16. [commandsHandler setDefaultOptions:@{
  17. @"animations": @{
  18. @"push": @{
  19. @"enabled": @(0)
  20. },
  21. @"pop": @{
  22. @"enabled": @(0)
  23. }
  24. },
  25. @"topBar": @{
  26. @"drawBehind": @(1)
  27. },
  28. @"layout": @{
  29. @"componentBackgroundColor": @(0xFF00FF00)
  30. }
  31. } completion:^{}];
  32. return commandsHandler;
  33. }
  34. @end