Browse files

Using NS_ENUM in place of typedef enum

  • Loading branch information...
1 parent e8b3e27 commit ae1d419cd403d6d888d939dde1057b56981a1f40 @mattt mattt committed Oct 9, 2012
Showing with 8 additions and 8 deletions.
  1. +4 −4 AFNetworking/AFHTTPClient.h
  2. +2 −2 AFNetworking/AFHTTPClient.m
  3. +2 −2 AFNetworking/AFURLConnectionOperation.m
View
8 AFNetworking/AFHTTPClient.h
@@ -72,12 +72,12 @@
*/
#ifdef _SYSTEMCONFIGURATION_H
-typedef enum {
+typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
AFNetworkReachabilityStatusUnknown = -1,
AFNetworkReachabilityStatusNotReachable = 0,
AFNetworkReachabilityStatusReachableViaWWAN = 1,
AFNetworkReachabilityStatusReachableViaWiFi = 2,
-} AFNetworkReachabilityStatus;
+};
#else
#warning "SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available."
#endif
@@ -86,11 +86,11 @@ typedef enum {
#warning "CoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available."
#endif
-typedef enum {
+typedef NS_ENUM(NSInteger, AFHTTPClientParameterEncoding) {
AFFormURLParameterEncoding,
AFJSONParameterEncoding,
AFPropertyListParameterEncoding,
-} AFHTTPClientParameterEncoding;
+};
@class AFHTTPRequestOperation;
@protocol AFMultipartFormData;
View
4 AFNetworking/AFHTTPClient.m
@@ -1036,12 +1036,12 @@ - (BOOL)_setCFClientFlags:(CFOptionFlags)inFlags
#pragma mark -
-typedef enum {
+typedef NS_ENUM(NSInteger, AFHTTPBodyPartReadPhase) {
AFEncapsulationBoundaryPhase = 1,
AFHeaderPhase = 2,
AFBodyPhase = 3,
AFFinalBoundaryPhase = 4,
-} AFHTTPBodyPartReadPhase;
+};
@interface AFHTTPBodyPart () {
AFHTTPBodyPartReadPhase _phase;
View
4 AFNetworking/AFURLConnectionOperation.m
@@ -30,12 +30,12 @@
// You can turn on ARC for only AFNetworking files by adding -fobjc-arc to the build phase for each of its files.
#endif
-typedef enum {
+typedef NS_ENUM(NSInteger, _AFOperationState) {
AFOperationPausedState = -1,
AFOperationReadyState = 1,
AFOperationExecutingState = 2,
AFOperationFinishedState = 3,
-} _AFOperationState;
+};
typedef signed short AFOperationState;

0 comments on commit ae1d419

Please sign in to comment.