This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/iOS/Example/Example/ViewController.m
2019-07-26 16:10:42 +08:00

43 lines
1.0 KiB
Objective-C

//
// ViewController.m
// Example
//
// Created by pengfei.zhou on 2019/7/25.
// Copyright © 2019 pengfei.zhou. All rights reserved.
//
#import "ViewController.h"
#import "UIView+Doric.h"
#import "DoricJSCoreExecutor.h"
#import "DoricUtil.h"
#import "DoricJSEngine.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
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);
}
DoricLog(@"%@",@"testxxxxx");
DoricLog(@"test2rwr");
DoricJSEngine *jsengine = [[DoricJSEngine alloc] init];
}
@end