在iOS中记录事件数量和事件时间
首选的安装方式是通过CocoaPods。只需添加
pod 'EventLogger'
并运行pod install。这将安装EventLogger的最新版本。
导入您想要记录事件的头文件
#import "EventLogger.h"
[[EventLogger sharedInstance] addCountEventWithTag:@"click_clean"];
开始记录EventCount2
;
[[EventLogger sharedInstance] addCountEventWithTag:@"EventCount2"];
从事件开始记录EventCount2
时间;
[[EventLogger sharedInstance] addTimeEventPoint:@"e12" withTag:@"TimeEven1" andInfo:nil timeFromPoint:@nil];
从点e12
记录EventCount2
时间;
[[EventLogger sharedInstance] addTimeEventPoint:@"e13" withTag:@"TimeEven1" andInfo:nil timeFromPoint:@"e12"];
就是这样!享受使用EventLogger吧!