Latest 1.0.1
Homepage https://github.com/zhuyunfeng1224/XHUserStatistics
License MIT
Platforms ios 8.0
Frameworks Foundation, UIKit
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

XHUserStatistics is available through CocoaPods. To install
it, simply add the following line to your Podfile:

安装

pod "XHUserStatistics", '~> 1.0.1'

创建plist文件

  • 首先创建一个名为UserStatistics的plist文件 UserStatistics.plist

创建plist文件

  • 在plist根节点下面添加两个节点分别为:pageEventsactionEvents

pageEvent用来添加页面事件
actionEvents用来添加自定义事件,但是只能添加controller内的方法
plist的结构如下:

<dict>
<key>pageEvents</key>
<dict>
<key>XHViewController</key>
<dict>
<key>pageName</key>
<string>mainPage</string>
<key>appear</key>
<true/>
<key>disAppear</key>
<true/>
</dict>
</dict>
<key>actionEvents</key>
<dict>
<key>buttonClicked:</key>
<dict>
<key>XHViewController</key>
<dict>
<key>eventId</key>
<string>clickButton</string>
</dict>
</dict>
</dict>
</dict>
  • 在AppDelegate中添加初始化语句
    
    [XHUserStastisticsManager manager].actionEventBlock = ^(XHActionEvent *actionEvent) {
    NSLog(@"there is a action Event: %@", actionEvent.eventId);
    };

[XHUserStastisticsManager manager].appearPageEventBlock = ^(XHPageEvent *pageEvent) {
NSLog(@"there is a appear event of page: %@", pageEvent.pageName);
};

[XHUserStastisticsManager manager].disappearPageEventBlock = ^(XHPageEvent *pageEvent) {
NSLog(@"there is a disappear event of page: %@", pageEvent.pageName);
};



## 注意:
  自定义事件所有的方法参数类型一定要是OC对象,不可以是基本类型,如:NSInteger要使用NSNumber类型

## Author

xihe, [email protected]

## License

XHUserStatistics is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "XHUserStatistics",
    "version": "1.0.1",
    "summary": "a auto statistics of page and event called XHUserStatistics.",
    "description": "TODO: A auto statistics of page and event called XHUserStatistics. You can use just add a plist file and a initialize statments.",
    "homepage": "https://github.com/zhuyunfeng1224/XHUserStatistics",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "xihe": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zhuyunfeng1224/XHUserStatistics.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "XHUserStatistics/Classes/**/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This