Created
July 18, 2015 11:25
-
-
Save remstos/0a32e8c272c3ccf567db to your computer and use it in GitHub Desktop.
React UI Manager bridge to use with Swift
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
// | |
// RCTUIManager+Swift.h | |
// RCTUIManager+Swift | |
// | |
// Created by Remi Santos on 30/06/15. | |
// Copyright © 2015 Facebook. All rights reserved. | |
// | |
#import "RCTUIManager.h" | |
#import "RCTSParseArray.h" | |
@interface RCTUIManager (Swift) | |
-(void)swift_addUIBlock:(void (^)(RCTUIManager*, RCTSparseArray*))block; | |
@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
// | |
// RCTUIManager+Swift.m | |
// RCTUIManager+Swift | |
// | |
// Created by Remi Santos on 30/06/15. | |
// Copyright © 2015 Facebook. All rights reserved. | |
// | |
#import "RCTUIManager+Swift.h" | |
@implementation RCTUIManager (Swift) | |
-(void)swift_addUIBlock:(void (^)(RCTUIManager*, RCTSparseArray*))block { | |
[self addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray*viewRegistry) { | |
block(uiManager, viewRegistry); | |
}]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It allows you to write this in Swift