Skip to content

Instantly share code, notes, and snippets.

@dsibiski
Created August 17, 2015 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsibiski/0c746deeb21c96b3a666 to your computer and use it in GitHub Desktop.
Save dsibiski/0c746deeb21c96b3a666 to your computer and use it in GitHub Desktop.
Pass a React Native view from JS to Obj-C
RCT_EXPORT_METHOD(doSomething:(NSNumber *)reactTag)
{
[_bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
UIView *view = viewRegistry[reactTag];
if ([view isKindOfClass:[UIView class]]) {
[view doSomething];
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment