Giter Club home page Giter Club logo

wuou / wocrashprotector Goto Github PK

View Code? Open in Web Editor NEW
222.0 11.0 46.0 788 KB

一个无侵入的 iOS crash 防护框架,基于 Swizzle Method 的 Crash 防护。能有效的防止代码潜在的crash,自动在app运行时实时捕获导致app崩溃的破环因子,使app避免崩溃,照样可以继续正常运行。 主要参考了《大白健康系统--iOS APP运行时Crash自动修复系统》此文,以及AvoidCrash、QYCrashProtector、NeverCrash这三个框架编写而成。更多内容请看项目吧。

License: MIT License

Objective-C 100.00%
crash crash-safe swizzle-method

wocrashprotector's Introduction

WOCrashProtector

Crash protection based on Swizzle Method. Can effectively prevent the code potential crash, automatically capture the broken loop factor that causes the app to crash when the app runs, so as to prevent the app from collapsing, so it can continue to function normally

前言

 一个无侵入的 iOS crash 防护框架,基于 Swizzle Method 的 Crash 防护。能有效的防止代码潜在的crash,自动在app运行时实时捕获导致app崩溃的破环因子,使app避免崩溃,照样可以继续正常运行。 主要参考了《大白健康系统--iOS APP运行时Crash自动修复系统》此文,以及AvoidCrashQYCrashProtectorNeverCrash这三个框架编写而成。更多内容请看项目吧。简书地址👈

功能

  • unrecognized selector crash
  • KVO、KVC crash
  • NSNotification crash
  • NSTimer crash
  • Container crash(数组越界,插nil,字典objc、key为nil等)
  • NSString crash(字符串截取越界等)
  • NSAttributedString

使用方法

导入#import "WOCrashProtectorManager.h"

/**
 启动所有组件
 */
+ (void)makeAllEffective;
     
/**
 单独启动组件

 @param protectorType 启动的组件类型
 */
+ (void)configCrashProtectorService:(WOCrashProtectorStyle)protectorType;

版本适配  

系统支持 iOS 8.0 ~ iOS 11.2

注意事项

** 建议实际开发的时候关闭该组件,以便及时发现crash bug,需要上架或者演示的时候开启crash防护组件。 **

  • 该组件中使用了@try@catch捕捉crash会占用极少量内存,不过正常情况下不影响性能。
  •  目前尚未测试其他第三方框架共同使用时是否存在冲突的情况,如bugly、友盟等。
  •  如果您发现了问题希望能issue,大家一起来解决问题 ^_^
  •  最后,如果你觉得这个框架对你有帮助就给个star吧 ^_^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.