-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit bd2b7d6.
- Loading branch information
Showing
5 changed files
with
100 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
#import <React/RCTBridgeModule.h> | ||
#import <React/RCTEventEmitter.h> | ||
|
||
@interface RCTModalManager : RCTEventEmitter <RCTBridgeModule> | ||
|
||
- (void)modalDismissed:(NSNumber *)modalID; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import "RCTModalManager.h" | ||
|
||
@interface RCTModalManager () | ||
|
||
@property BOOL shouldEmit; | ||
|
||
@end | ||
|
||
@implementation RCTModalManager | ||
|
||
RCT_EXPORT_MODULE(); | ||
|
||
- (NSArray<NSString *> *)supportedEvents | ||
{ | ||
return @[ @"modalDismissed" ]; | ||
} | ||
|
||
- (void)startObserving | ||
{ | ||
_shouldEmit = YES; | ||
} | ||
|
||
- (void)stopObserving | ||
{ | ||
_shouldEmit = NO; | ||
} | ||
|
||
- (void)modalDismissed:(NSNumber *)modalID | ||
{ | ||
if (_shouldEmit) { | ||
[self sendEventWithName:@"modalDismissed" body:@{ @"modalID": modalID }]; | ||
} | ||
} | ||
|
||
@end |