Last active
August 25, 2016 13:53
-
-
Save sibelius/22231e96c4a5c1feb2af82d3276e0a14 to your computer and use it in GitHub Desktop.
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
@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 |
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
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