Skip to content
Browse files

Simplifying #ifdef availability macros for UIKit categories

  • Loading branch information...
1 parent 9ff1697 commit 58409b6c4e7369ea478149bbd20177f8196f3f77 @mattt mattt committed
View
3 UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
@@ -28,7 +28,6 @@
#import <UIKit/UIKit.h>
-
@class AFURLConnectionOperation;
/**
@@ -45,7 +44,7 @@
@param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
*/
-#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
#endif
View
4 UIKit+AFNetworking/UIProgressView+AFNetworking.h
@@ -45,7 +45,7 @@
@param task The session task.
@param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
*/
-#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
animated:(BOOL)animated;
#endif
@@ -56,7 +56,7 @@
@param task The session task.
@param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
*/
-#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
animated:(BOOL)animated;
#endif
View
4 UIKit+AFNetworking/UIProgressView+AFNetworking.m
@@ -74,7 +74,6 @@ - (void)af_setDownloadProgressAnimated:(BOOL)animated {
#pragma mark -
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
-
- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
animated:(BOOL)animated
{
@@ -92,7 +91,6 @@ - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
[self af_setDownloadProgressAnimated:animated];
}
-
#endif
#pragma mark -
@@ -142,7 +140,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
change:(__unused NSDictionary *)change
context:(void *)context
{
-#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) {
if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) {
if ([object countOfBytesExpectedToSend] > 0) {

0 comments on commit 58409b6

Please sign in to comment.
Something went wrong with that request. Please try again.