AppSwizzle
Context
This library is derived from the GodEye project which can automaticly disply Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code. Just like god opened his eyes
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requirements
Installation
CocoaPods
AppSwizzle is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "AppSwizzle"
Carthage
Or, if you’re using Carthage, add SwViewCapture to your Cartfile:
github "zixun/AppSwizzle"
Usage
Swizzle Instance Method
let orig = #selector(AppSwizzleTests.origSelector_testSwizzleInstanceMethod)
let alter = #selector(AppSwizzleTests.alterSelector_testSwizzleInstanceMethod)
AppSwizzleTests.swizzleInstanceMethod(origSelector: orig, toAlterSelector: alter)
Swizzle Class Method
let orig = #selector(AppSwizzleTests.origSelector_testSwizzleClassMethod)
let alter = #selector(AppSwizzleTests.alterSelector_testSwizzleClassMethod)
AppSwizzleTests.swizzleClassMethod(origSelector: orig, toAlterSelector: alter)
Swizzle Instance Method To Alter Class
let orig = #selector(AppSwizzleTests.origSelector_testSwizzleInstanceMethodToAlterClass)
let alter = #selector(OtherClass.alterSelector_testSwizzleInstanceMethodToAlterClass)
AppSwizzleTests.swizzleInstanceMethod(origSelector: orig, toAlterSelector: alter, inAlterClass: OtherClass.classForCoder())
Swizzle Class Method To Alter Class
let orig = #selector(AppSwizzleTests.origSelector_testSwizzleClassMethodToAlterClass)
let alter = #selector(OtherClass.alterSelector_testSwizzleClassMethodToAlterClass)
AppSwizzleTests.swizzleClassMethod(origSelector: orig, toAlterSelector: alter, inAlterClass: OtherClass.classForCoder())
Author
name: 陈奕龙
twitter: @zixun_
email: [email protected]
github: zixun
blog: 子循(SubCycle)
License
AppSwizzle is available under the MIT license. See the LICENSE file for more info.