coooliang / CLAspects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLAspects

统一管理埋点,使用JSON格式对项目进行埋点处理,支持动态属性。

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ViewController *viewController = [[ViewController alloc]init];
    UINavigationController *root = [[UINavigationController alloc]initWithRootViewController:viewController];
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window setRootViewController:root];
    [self.window makeKeyAndVisible];
    
    [NSTimer scheduledTimerWithTimeInterval:0.1 repeats:NO block:^(NSTimer * _Nonnull timer) {
        [self md];
    }];
    return YES;
}

- (void)md {
    CLAConfigOptions *options = [[CLAConfigOptions alloc]init];
    options.debug = YES;
    [[CLAspects sharedInstance]aop:options block:^(NSDictionary *result) {
        NSLog(@"result = %@",result);
    } configBlock:^(NSString *html) {
        NSLog(@"config = %@",html);
    }];
}

  • debug模式,网页查看埋点表格

drawing

About

License:MIT License


Languages

Language:Objective-C 88.6%Language:HTML 6.7%Language:Ruby 4.7%