Latest 0.0.1
Homepage https://github.com/PonyCui/PPPatch
License MIT
Platforms ios 6.0, requires ARC
Dependencies Aspects
Authors

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.

Introduce

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.

Example

{
  "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."
    }
  ]
}
  • Add above code to - 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.

Patch Type

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
};

Installation

CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like JSPatch in your projects. See the "Getting Started" guide for more information.

# Your Podfile
platform :ios, '6.0'
pod 'PPPatch'

Manually

Copy *.m *.h in Src/ to your project.

Notice

  • PPPatch is 0.0.1 beta.
  • PPPatch can cache previous patch data, while user network or server not stable, patch still effects.

Latest podspec

{
    "name": "PPPatch",
    "version": "0.0.1",
    "summary": "PPPatch helps you patch released application.",
    "description": "                   PPPatch is a light weight method swizzling library, provides above functions.n                   1.Invalid a class selector;n                   2.Show custom UIAlertView once or everytime when selector triggered;n                   3.Return custom value for specific selector;n                   4.Remove a view from superView;n                   5.Disabled a view (make userInteractionEnabled = NO);n                   6.Perform KVC to view.n",
    "homepage": "https://github.com/PonyCui/PPPatch",
    "license": "MIT",
    "authors": {
        "PonyCui": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/PonyCui/PPPatch.git",
        "tag": "0.0.1"
    },
    "source_files": "Src",
    "requires_arc": true,
    "dependencies": {
        "Aspects": []
    }
}

Pin It on Pinterest

Share This