-
Notifications
You must be signed in to change notification settings - Fork 0
/
ETNetworkPrivate.m
executable file
·66 lines (56 loc) · 1.8 KB
/
ETNetworkPrivate.m
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// ETBaseRequest.m
//
// Copyright (c) 2012-2016 YTKNetwork https://github.com/yuantiku
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//
// ETBaseRequestPrivate.h
// 能量圈
//
// Created by vj on 2017/3/27.
// Copyright © 2017年 Weijie Zhu. All rights reserved.
#import <CommonCrypto/CommonDigest.h>
#import "ETNetworkPrivate.h"
#if __has_include(<AFNetworking/AFNetworking.h>)
#import <AFNetworking/AFURLRequestSerialization.h>
#else
#import "AFURLRequestSerialization.h"
#endif
void YTKLog(NSString *format, ...) {
#ifdef DEBUG
// if (![ETNetworkConfig sharedConfig].debugLogEnabled) {
// return;
// }
va_list argptr;
va_start(argptr, format);
NSLogv(format, argptr);
va_end(argptr);
#endif
}
@implementation ETBaseRequest (RequestAccessory)
- (void)toggleAccessoriesWillStartCallBack {
for (id<ETRequestAccessory> accessory in self.requestAccessories) {
if ([accessory respondsToSelector:@selector(requestWillStart:)]) {
[accessory requestWillStart:self];
}
}
}
- (void)toggleAccessoriesWillStopCallBack {
for (id<ETRequestAccessory> accessory in self.requestAccessories) {
if ([accessory respondsToSelector:@selector(requestWillStop:)]) {
[accessory requestWillStop:self];
}
}
}
- (void)toggleAccessoriesDidStopCallBack {
for (id<ETRequestAccessory> accessory in self.requestAccessories) {
if ([accessory respondsToSelector:@selector(requestDidStop:)]) {
[accessory requestDidStop:self];
}
}
}
@end