Last active
June 3, 2019 08:41
-
-
Save troZee/1995bfce1d53f79c7930404d203eb930 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#import <React/RCTViewManager.h> | |
#import <React/RCTUIManager.h> | |
#import <React/RCTLog.h> | |
RCT_EXPORT_METHOD(goToPreviousPage:(nonnull NSNumber*) reactTag) { | |
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) { | |
NativeView *view = viewRegistry[reactTag]; | |
if (!view || ![view isKindOfClass:[NativeView class]]) { | |
RCTLogError(@"Cannot find NativeView with tag #%@", reactTag); | |
return; | |
} | |
[view goToPreviousPage]; | |
}]; | |
} | |
RCT_EXPORT_METHOD(goToNextPage:(nonnull NSNumber*) reactTag) { | |
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) { | |
NativeView *view = viewRegistry[reactTag]; | |
if (!view || ![view isKindOfClass:[NativeView class]]) { | |
RCTLogError(@"Cannot find NativeView with tag #%@", reactTag); | |
return; | |
} | |
[view goToNextPage]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment