AFNetworking / AFNetworking

Compare 2da270b ... +4 ... 8288b80


@@ -109,11 +109,9 @@
Loading
109 109
110 110
- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible {
111 111
    if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) {
112 -
        [self willChangeValueForKey:@"networkActivityIndicatorVisible"];
113 112
        @synchronized(self) {
114 -
             _networkActivityIndicatorVisible = networkActivityIndicatorVisible;
113 +
            _networkActivityIndicatorVisible = networkActivityIndicatorVisible;
115 114
        }
116 -
        [self didChangeValueForKey:@"networkActivityIndicatorVisible"];
117 115
        if (self.networkActivityActionBlock) {
118 116
            self.networkActivityActionBlock(networkActivityIndicatorVisible);
119 117
        } else {
@@ -122,35 +120,20 @@
Loading
122 120
    }
123 121
}
124 122
125 -
- (void)setActivityCount:(NSInteger)activityCount {
126 -
	@synchronized(self) {
127 -
		_activityCount = activityCount;
128 -
	}
129 -
130 -
    dispatch_async(dispatch_get_main_queue(), ^{
131 -
        [self updateCurrentStateForNetworkActivityChange];
132 -
    });
133 -
}
134 123
135 124
- (void)incrementActivityCount {
136 -
    [self willChangeValueForKey:@"activityCount"];
137 -
	@synchronized(self) {
138 -
		_activityCount++;
139 -
	}
140 -
    [self didChangeValueForKey:@"activityCount"];
141 -
125 +
    @synchronized(self) {
126 +
        self.activityCount++;
127 +
    }
142 128
    dispatch_async(dispatch_get_main_queue(), ^{
143 129
        [self updateCurrentStateForNetworkActivityChange];
144 130
    });
145 131
}
146 132
147 133
- (void)decrementActivityCount {
148 -
    [self willChangeValueForKey:@"activityCount"];
149 -
	@synchronized(self) {
150 -
		_activityCount = MAX(_activityCount - 1, 0);
151 -
	}
152 -
    [self didChangeValueForKey:@"activityCount"];
153 -
134 +
    @synchronized(self) {
135 +
        self.activityCount = MAX(_activityCount - 1, 0);
136 +
    }
154 137
    dispatch_async(dispatch_get_main_queue(), ^{
155 138
        [self updateCurrentStateForNetworkActivityChange];
156 139
    });
@@ -172,7 +155,6 @@
Loading
172 155
- (void)setCurrentState:(AFNetworkActivityManagerState)currentState {
173 156
    @synchronized(self) {
174 157
        if (_currentState != currentState) {
175 -
            [self willChangeValueForKey:@"currentState"];
176 158
            _currentState = currentState;
177 159
            switch (currentState) {
178 160
                case AFNetworkActivityManagerStateNotActive:
@@ -191,9 +173,7 @@
Loading
191 173
                    [self startCompletionDelayTimer];
192 174
                    break;
193 175
            }
194 -
            [self didChangeValueForKey:@"currentState"];
195 176
        }
196 -
        
197 177
    }
198 178
}
199 179

@@ -103,11 +103,11 @@
Loading
103 103
104 104
+ (AFImageDownloader *)sharedImageDownloader {
105 105
106 -
    return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
106 +
    return objc_getAssociatedObject([UIButton class], @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
107 107
}
108 108
109 109
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
110 -
    objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
110 +
    objc_setAssociatedObject([UIButton class], @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
111 111
}
112 112
113 113
#pragma mark -

@@ -48,11 +48,11 @@
Loading
48 48
@implementation UIImageView (AFNetworking)
49 49
50 50
+ (AFImageDownloader *)sharedImageDownloader {
51 -
    return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
51 +
    return objc_getAssociatedObject([UIImageView class], @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
52 52
}
53 53
54 54
+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
55 -
    objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
55 +
    objc_setAssociatedObject([UIImageView class], @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
56 56
}
57 57
58 58
#pragma mark -

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
AFNetworking 77.12%
UIKit+AFNetworking 0.47% 85.71%
Project Totals (15 files) 79.67%
Loading