react-native-navigation的迁移库

RNNEventEmitter.m 848B

12345678910111213141516171819202122232425262728293031323334353637
  1. #import "RNNEventEmitter.h"
  2. @implementation RNNEventEmitter
  3. RCT_EXPORT_MODULE();
  4. static NSString* const onAppLaunched = @"RNN.appLaunched";
  5. static NSString* const containerDidAppear = @"RNN.containerDidAppear";
  6. static NSString* const containerDidDisappear = @"RNN.containerDidDisappear";
  7. -(NSArray<NSString *> *)supportedEvents {
  8. return @[onAppLaunched, containerDidAppear, containerDidDisappear];
  9. }
  10. # pragma mark public
  11. -(void)sendOnAppLaunched {
  12. [self send:onAppLaunched body:nil];
  13. }
  14. -(void)sendContainerDidAppear:(NSString *)containerId {
  15. [self send:containerDidAppear body:containerId];
  16. }
  17. -(void)sendContainerDidDisappear:(NSString *)containerId {
  18. [self send:containerDidDisappear body:containerId];
  19. }
  20. # pragma mark private
  21. -(void)send:(NSString *)eventName body:(id)body {
  22. [self sendEventWithName:eventName body:body];
  23. }
  24. @end