Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import Foundation
import UIKit
import SpreadsheetView
class SampleView: UIView {
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 150, height: 50))
private var _txt: String = "This is swift"
override init(frame: CGRect) {
super.init(frame: frame)
self.label.text = "This is SWIFT"
self.addSubview(self.label)
let controller = ViewController();
self.addSubview(controller.view);
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
var txt: NSString? {
set {
if newValue != nil {
self._txt = newValue! as String;
//self.setNeedsDisplay();
self.label.text = self._txt;
}
}
get {
return nil;
}
}
}
import Foundation
@objc(SampleViewManager)
class SampleViewManager : RCTViewManager {
override func view() -> UIView! {
return SampleView();
}
}
#import <Foundation/Foundation.h>
#import <React/RCTView.h>
@interface SampleViewModule : RCTView
@property (nonatomic, assign) NSString *txt;
@end
#import <React/RCTBridgeModule.h>
#import <React/RCTViewManager.h>
#import "SampleViewModule.h"
@interface RCT_EXTERN_MODULE(SampleViewManager, RCTViewManager)
RCT_EXPORT_VIEW_PROPERTY(txt, NSString);
@end
#import "React/RCTViewManager.h"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment