AppEventTracker 1.0.1

AppEventTracker 1.0.1

Ioannis Diamantidis 维护。



  • 作者:
  • diamantidis

AppEventTracker

CI Status Version License Platform Swift codecov

AppEventTracker 是一个 iOS 库,通过向不同的函数注入代码来自动跟踪各种事件,例如 `viewDidLoad`、`didReceiveMemoryWarning` 或 `sendAction`。创建这个库的初衷是为了在崩溃前跟踪最后 10 个事件(例如),使用户能够更好地理解崩溃前用户的行为。

示例

要运行示例项目,请克隆仓库,然后首先从 Example 目录运行 `pod install`。

要求

  • iOS 9.3+
  • Xcode 10.1+
  • Swift 4.2+

安装

CocoaPods

CocoaPods 是针对 Cocoa 项目的依赖管理器。您可以通过以下命令安装它:

$ gem install cocoapods

AppEventTracker 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:

pod 'AppEventTracker'

然后,运行以下命令:

$ pod install

使用方法

// Import the library
import AppEventTracker
// Declare the number of the events to keep. 
AppEventTracker.configure(size: 10)
// Activate the events related with the viewDidLoad
AppEventTracker.enableViewDidLoad()
// Activate the events related with the UIButton's sendAction
AppEventTracker.enableUIButtonSendAction()
// Activate the events related with the UIViewController's didReceiveMemoryWarning
AppEventTracker.enableDidReceiveMemoryWarning()
// Get the events 
print(AppEventTracker.events)

可用于向 Hockeyapp 发送描述。

func applicationLog(for crashManager: BITCrashManager!) -> String! {
// prints "UIViewController1 > UIViewController2 > UIViewController3"
return AppEventTracker.events.map{ $0.name }.joined(separator: " > ")
}

作者

Ioannis Diamantidis,[email protected]

许可证

AppEventTracker 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。