Selaa lähdekoodia

Clean up KVO support. (#47)

Peter Andrews 4 vuotta sitten
vanhempi
sitoutus
3f4c51391b
2 muutettua tiedostoa jossa 2 lisäystä ja 10 poistoa
  1. 2 3
      GoogleSignIn/Sources/GIDSignIn.m
  2. 0 7
      GoogleSignIn/Tests/Unit/GIDSignInTest.m

+ 2 - 3
GoogleSignIn/Sources/GIDSignIn.m

@@ -755,10 +755,9 @@ static const NSTimeInterval kMinimumRestoredAccessTokenTimeToExpire = 600.0;
 #pragma mark - Key-Value Observing
 
 // Override |NSObject(NSKeyValueObservingCustomization)| method in order to provide custom KVO
-// notifications for |clientID| and |currentUser| properties.
+// notifications for the |currentUser| property.
 + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
-  if ([key isEqual:NSStringFromSelector(@selector(clientID))] ||
-      [key isEqual:NSStringFromSelector(@selector(currentUser))]) {
+  if ([key isEqual:NSStringFromSelector(@selector(currentUser))]) {
     return NO;
   }
   return [super automaticallyNotifiesObserversForKey:key];

+ 0 - 7
GoogleSignIn/Tests/Unit/GIDSignInTest.m

@@ -314,10 +314,6 @@ static void *kTestObserverContext = &kTestObserverContext;
     strongSelf->_authError = error;
   };
 
-  [_signIn addObserver:self
-            forKeyPath:NSStringFromSelector(@selector(clientID))
-               options:0
-               context:kTestObserverContext];
   [_signIn addObserver:self
             forKeyPath:NSStringFromSelector(@selector(currentUser))
                options:0
@@ -337,9 +333,6 @@ static void *kTestObserverContext = &kTestObserverContext;
   [_fakeMainBundle stopFaking];
   [super tearDown];
 
-  [_signIn removeObserver:self
-               forKeyPath:NSStringFromSelector(@selector(clientID))
-                  context:kTestObserverContext];
   [_signIn removeObserver:self
                forKeyPath:NSStringFromSelector(@selector(currentUser))
                   context:kTestObserverContext];