/
NSURLConnection+Swizzled.h
47 lines (39 loc) · 1.15 KB
/
NSURLConnection+Swizzled.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// NSURLConnection+Swizzled.h
//
// Created by Rui Peres on 27/07/13.
// Copyright (c) 2013 Rui Peres. All rights reserved.
//
#import <Foundation/Foundation.h>
#define STOP_STACKTRACE_SWIZZ [NSURLConnection stopStackTrace];
#define SWIZZ_IT [NSURLConnection swizzIt];
#define UN_SWIZZ_IT [NSURLConnection undoSwizz];
/**
Category used to "log curl command line prompts for debugging purposes".
This category was inspired on NSMutableURLRequest+MKCurlAdditions from
MugunthKumar. You can find it here:
https://github.com/MugunthKumar/CurlNSMutableURLRequestDemo
It will also print the stacktrace so you can understand from where this call is
coming from.
*/
@interface NSURLConnection (Swizzled)
/**
It will swizz the methods:
1) sendAsynchronousRequest:queue:completionHandler:
2) initWithRequest:delegate:startImmediately:
The first one was selected because I use quite often.
The second one because AFNetworking uses it.
@return void
*/
+ (void)swizzIt;
/**
It will undo what was done with the swizzIt
@return void
*/
+ (void)undoSwizz;
/**
It will stop outputing the stacktrace information
@return void
*/
+ (void)stopStackTrace;
@end