Created
July 11, 2019 17:58
-
-
Save andrepimenta/6db692a7c339e5d957ad66146e0788f9 to your computer and use it in GitHub Desktop.
React Native iOS Bridge TEMPLATE
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
// | |
// BridgeTemplate.m | |
// ReactNativeLoadingSpinnerOverlayNative | |
// | |
// Created by Andre Pimenta on 11/07/2019. | |
// Copyright © 2019 Facebook. All rights reserved. | |
// | |
#import "React/RCTLog.h" | |
#import "LoadingOverlay.h" // Here put the name of your module | |
@implementation LoadingOverlay // Here put the name of your module | |
// This RCT (React) "macro" exposes the current module to JavaScript | |
RCT_EXPORT_MODULE(); | |
RCT_EXPORT_METHOD(toggle:(BOOL *)show | |
resolver:(RCTPromiseResolveBlock)resolve | |
rejecter:(RCTPromiseRejectBlock)reject) | |
{ | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
@try{ | |
resolve(@{ @"key": [NSNumber numberWithBool:1] }); | |
} | |
@catch(NSException *exception){ | |
reject(@"get_error",exception.reason, nil); | |
} | |
}); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment