Created
April 6, 2012 19:02
-
-
Save steipete/2322095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isNetworkActivityIndicatorVisible { | |
return _activityCount > 0; | |
} | |
- (void)incrementActivityCount { | |
[self willChangeValueForKey:@"activityCount"]; | |
OSAtomicIncrement32((int32_t*)&_activityCount); | |
[self didChangeValueForKey:@"activityCount"]; | |
} | |
- (void)decrementActivityCount { | |
[self willChangeValueForKey:@"activityCount"]; | |
OSAtomicDecrement32((int32_t*)&_activityCount); | |
[self didChangeValueForKey:@"activityCount"]; | |
} | |
+ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible { | |
return [NSSet setWithObject:@"activityCount"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment