add DoricJSCore

This commit is contained in:
pengfei.zhou
2019-07-25 21:03:31 +08:00
parent f912c49eed
commit 4aa049fc04
18 changed files with 303 additions and 137 deletions

View File

@@ -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);
}
}