TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2015 |
Maintained by PonyCui.
PPPatch helps you patch released application.
We all know that to fix a release application needs to provide a package to iTunesConnect, also you need to apply specail request. Is there any great way to avoid that? PPPatch is the best library helps you resolve this problem.
PPPatch is a light weight method swizzling library, provides above functions.
1.Invalid a class selector;
2.Show custom UIAlertView once or everytime when selector triggered;
3.Return custom value for specific selector;
4.Remove a view from superView;
5.Disabled a view (make userInteractionEnabled = NO);
6.Perform KVC to view.
{
"ver": "1.0",
"items": [
{
"category": "PPPatchSelectorItem",
"className": "ViewController",
"selectorName": "testLog",
"patchType": "100"
},
{
"category": "PPPatchSelectorItem",
"className": "ViewController",
"selectorName": "testLog",
"patchType": "101",
"alertTextString": "Test log temperary unavailable."
}
]
}
- application:didFinishLaunchingWithOptions:
[PPPatch setEnabled:YES];
[PPPatch setPatchURLString:@"https://raw.githubusercontent.com/PonyCui/PPPatch/master/PPPatch/patch.json"];
[PPPatch fetchPatchWithTimeout:3.0];
Okay, that's enough. The final result see demo please.
The patchType defines an item operation.
/**
* PPPatch Type
*/
typedef NS_ENUM(NSInteger, PPPatchType){
/**
* Unknown Type
*/
PPPatchTypeUnknown = 0,
/**
* Invalid a class selector
*/
PPPatchTypeSelectorInvalid = 100,
/**
* Show AlertView when selector performs
*/
PPPatchTypeSelectorAlert = 101,
/**
* Replace return value
*/
PPPatchTypeSelectorReturn = 102,
/**
* Same as PPPatchTypeSelectorAlert, but alertView only show once each app version.
*/
PPPatchTypeSelectorAlertOnce = 103,
/**
* Remove User Interface from superView
*/
PPPatchTypeUIRemoveFromSuperView = 200,
/**
* Disable User Interface
*/
PPPatchTypeUIDisabled = 201,
/**
* Set UI Key => Value
*/
PPPatchTypeUISettingKeyValue = 202
};
Copy *.m
*.h
in Src/
to your project.