Latest 0.0.1
Homepage https://github.com/SmatMing/XMSafeProtector
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

使用须知

  • 防止crash组件框架,用于常用方法crash防护。包含多种防护。
  • 适用于ios8以上系统,其他系统可能会有不兼容的问题。

使用方法

  • 使用方法:下载导入工程,如图所示:
    XMSafeProtector
    crash的实时会回调上边的block,这是你就可根据需要把crashLog日志上传到自己服务器或者第三方平台。debug下方法内部会自动打印出crashLog。

crash防护效果输出日志

  • 这是未开启防护是时的crash截图
    XMSafeProtector
  • 这是开启防护是时,捕获到crash截图,如果[Error Place]没有定位到具体的位置,就需要手动去符号了
    XMSafeProtector
  • 可下载运行工程演示

crash防护支持一下几种类型

typedef NS_ENUM(NSInteger, XMCrashProtectorType) {
XMCrashProtectorTypeAll = 0,         /*开启所有的保护*/
XMCrashProtectorTypeSelector = 1<<0, /*UnrecognizedSelector保护*/
XMCrashProtectorTypeKVO = 1<<1,       /*KVO保护*/
XMCrashProtectorTypeContainer = 1<<2, /*容器保护,包括:包括NSArray、NSMutableArray、 NSDictionary、NSMutableDictionary、NSString、 NSMutableString*/
XMCrashProtectorCrashTypeNotification = 1<<3, /*通知保护*/
XMCrashProtectorCrashTimer = 1<<4,  /*定时器保护*/
};
  • 具体支持的防护方法请见各防护类的.h文件。

Latest podspec

{
    "name": "XMSafeProtector",
    "version": "0.0.1",
    "summary": "This is a crash protector component.",
    "description": "In order to prevent the application program from flash back due to the use of cash in the process of app application, which gave users a bad experience, this crash protective component was written, hoping to bring users a good experience.",
    "homepage": "https://github.com/SmatMing/XMSafeProtector",
    "license": "MIT",
    "authors": {
        "SmatMing": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/SmatMing/XMSafeProtector.git",
        "tag": "0.0.1"
    },
    "source_files": "XMSafeProtector/**/*.{h,m}",
    "exclude_files": "XMSafeProtector/Exclude",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This