Skip to content

Instantly share code, notes, and snippets.

@sibelius
Last active August 25, 2016 13:53
Show Gist options
  • Save sibelius/22231e96c4a5c1feb2af82d3276e0a14 to your computer and use it in GitHub Desktop.
Save sibelius/22231e96c4a5c1feb2af82d3276e0a14 to your computer and use it in GitHub Desktop.
@interface Person : NSObject <RCTBridgeModule>
@end
@implementation Logger
RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(greet:(NSString *)name)
{
NSLog(@"Hi, %@!", name);
[_bridge.eventDispatcher sendAppEventWithName:@"greeted"
body:@{ @"name": name }];
}
@end
import UIKit
class SampleView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 100,
height: 50))
label.text = “This is Swift”
self.addSubview(label)
}
required init?(coder aDecoder: NSCoder) {
fatalError(“init(coder:) has not been implemented”)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment