Latest 0.1.0
License MIT
Platforms ios 8.0, osx 10.8, requires ARC
Dependencies CocoaSecurity
Frameworks Foundation

This is a iOS network intercepter ,you can you this code mocking you network data ,inclue native code request and webView(WKWebView/UIWebView) request.


pod 'PBURLProtocol'


It’s easy to use.

[PBURLProtocol setInterceptRule:^BOOL(NSURLRequest *request) {
    //set up which requet will be block
    return YES;

[PBURLProtocol setRebuildBlock:^NSURLRequest *(NSURLRequest *orignal) {
    //rebuild the request
    NSMutableURLRequest *req = orignal.mutableCopy;
    req.URL = [NSURL URLWithString:@""];
    return req;
//custom which scheme will be intercept(just aviable from ios 9.0)
[PBURLProtocol enableScheme:@"http"];
[PBURLProtocol start];

Latest podspec

    "name": "PBURLProtocol",
    "version": "0.1.0",
    "summary": "PBURLProtocol",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE.txt"
    "authors": {
        "PB-Tech": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "platforms": {
        "ios": "8.0",
        "osx": "10.8"
    "frameworks": "Foundation",
    "source_files": "src/**/*.{m,h}",
    "public_header_files": "src/**/*.h",
    "requires_arc": true,
    "dependencies": {
        "CocoaSecurity": []

Pin It on Pinterest

Share This