TrackRecorder 0.1.2

TrackRecorder 0.1.2

eason 维护。



  • eason

TrackRecorder

Version License Platform

要求

  • iOS 10.0+

用法

示例

运行示例项目前,请先从仓库中克隆项目,并在 Example 目录中运行 pod install

安装

TrackRecorder 可通过 CocoaPods 获取。安装时,只需在 Podfile 中添加以下行即可

pod 'TrackRecorder'

快速入门

代码
  • 首先需要引入头文件

#import <TrackRecorder/TrackRecordManager.h>

  • 添加代理

<TrackRecordDelegate>

TrackRecordManager.sharedInstance.delegate = **self**;

  • 实现代理方法

    - (void)TrackRecordClickWithDictionary:(nonnull NSDictionary *)dic {
    
        NSLog(@"click%@",dic);
    
    }
    - (void)TrackRecordVisitWithDictionary:(nonnull NSDictionary *)dic {
    
        NSLog(@"visit%@",dic);
    
    }
    
配置文件

需要在本地项目中创建一个名为"TrackRecordConfig"的plist文件

文件格式如图:

image-confitPlist

使用方法:

  • PageEvents:

在PageEvents下新建一个Dictionary,以Controller名字作为key(如果是swift项目需要在前面添加项目名称)

  • ControlEvents:

在ControlEvents下新建一个Dictionary,以方法点击事件名称作为key,如果是swift代码需要将事件名称进行转换如:@objc func countDownAction(sender: CountDownButton) 转换为countDownActionWithSender:

  • CollectionViewEvents和TableViewEvents:

在TableViewEvents或CollectionViewEvents下新建Dictionary,section作为一级key,row作为二级key

  • TapEvents:

在TapEvents下新建Dictionary,控制器名字作为一级key(如果是swift项目需要在前面加项目名称),加载手势的视图的tag作为二级key

作者

eason, [email protected]

许可

TrackRecorder遵循MIT许可。详细信息请参阅LICENSE文件。