add DoricJSCore
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
#import "UIView+Doric.h"
|
||||
#import "DoricJSCoreExecutor.h"
|
||||
|
||||
@interface ViewController ()
|
||||
|
||||
@@ -16,7 +18,19 @@ @implementation ViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.text = @"Hello,Doric";
|
||||
[label sizeToFit];
|
||||
label.centerX = self.view.width/2;
|
||||
label.centerY = self.view.height/2;
|
||||
[self.view addSubview:label];
|
||||
DoricJSCoreExecutor *jse = [[DoricJSCoreExecutor alloc] init];
|
||||
@try{
|
||||
NSString *ret = [jse loadJSScript:@"typef Reflect" source:@"test"];
|
||||
NSLog(@"js result %@", ret);
|
||||
}@catch(NSException *e){
|
||||
NSLog(@"catch Exception: %@,reason is %@",e.name,e.reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user