Browse Source

Renamed notification observers.

Brian Nickel 10 years ago
parent
commit
b6562dabcb

+ 10 - 10
UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m

@@ -30,7 +30,7 @@
 #import "AFURLSessionManager.h"
 #endif
 
-@interface AFActivityIndicatorAnimator : NSObject
+@interface AFActivityIndicatorViewNotificationObserver : NSObject
 @property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView;
 - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView;
 
@@ -43,28 +43,28 @@
 
 @implementation UIActivityIndicatorView (AFNetworking)
 
-- (AFActivityIndicatorAnimator *)af_activityIndicatorAnimator {
-    AFActivityIndicatorAnimator *animator = objc_getAssociatedObject(self, @selector(af_activityIndicatorAnimator));
-    if (animator == nil) {
-        animator = [[AFActivityIndicatorAnimator alloc] initWithActivityIndicatorView:self];
-        objc_setAssociatedObject(self, @selector(af_activityIndicatorAnimator), animator, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver {
+    AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));
+    if (notificationObserver == nil) {
+        notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self];
+        objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
     }
-    return animator;
+    return notificationObserver;
 }
 
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
 - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
-    [[self af_activityIndicatorAnimator] setAnimatingWithStateOfTask:task];
+    [[self af_notificationObserver] setAnimatingWithStateOfTask:task];
 }
 #endif
 
 - (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation {
-    [[self af_activityIndicatorAnimator] setAnimatingWithStateOfOperation:operation];
+    [[self af_notificationObserver] setAnimatingWithStateOfOperation:operation];
 }
 
 @end
 
-@implementation AFActivityIndicatorAnimator
+@implementation AFActivityIndicatorViewNotificationObserver
 
 - (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView
 {

+ 10 - 10
UIKit+AFNetworking/UIRefreshControl+AFNetworking.m

@@ -31,7 +31,7 @@
 #import "AFURLSessionManager.h"
 #endif
 
-@interface AFRefreshControlAnimator : NSObject
+@interface AFRefreshControlNotificationObserver : NSObject
 @property (readonly, nonatomic, weak) UIRefreshControl *refreshControl;
 - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl;
 
@@ -44,28 +44,28 @@
 
 @implementation UIRefreshControl (AFNetworking)
 
-- (AFRefreshControlAnimator *)af_refreshControlAnimator {
-    AFRefreshControlAnimator *animator = objc_getAssociatedObject(self, @selector(af_refreshControlAnimator));
-    if (animator == nil) {
-        animator = [[AFRefreshControlAnimator alloc] initWithActivityRefreshControl:self];
-        objc_setAssociatedObject(self, @selector(af_refreshControlAnimator), animator, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+- (AFRefreshControlNotificationObserver *)af_notificationObserver {
+    AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));
+    if (notificationObserver == nil) {
+        notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self];
+        objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
     }
-    return animator;
+    return notificationObserver;
 }
 
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
 - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
-    [[self af_refreshControlAnimator] setRefreshingWithStateOfTask:task];
+    [[self af_notificationObserver] setRefreshingWithStateOfTask:task];
 }
 #endif
 
 - (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation {
-    [[self af_refreshControlAnimator] setRefreshingWithStateOfOperation:operation];
+    [[self af_notificationObserver] setRefreshingWithStateOfOperation:operation];
 }
 
 @end
 
-@implementation AFRefreshControlAnimator
+@implementation AFRefreshControlNotificationObserver
 
 - (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl
 {