From df140116b861cb9cc6c1d5e7130a129a4a637a0f Mon Sep 17 00:00:00 2001 From: Mattt Thompson Date: Mon, 24 Sep 2012 08:26:38 -0700 Subject: [PATCH] Moving AFSwizzleClassMethodWithClassAndSelectorUsingBlock function --- AFNetworking/AFHTTPRequestOperation.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index 1021681..bc7095d 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -60,12 +60,6 @@ NSSet * AFContentTypesFromHTTPHeader(NSString *string) { return [NSSet setWithSet:mutableContentTypes]; } -static void AFSwizzleClassMethodWithClassAndSelectorUsingBlock(Class klass, SEL selector, id block) { - Method originalMethod = class_getClassMethod(klass, selector); - IMP implementation = imp_implementationWithBlock((AF_CAST_TO_BLOCK)block); - class_replaceMethod(objc_getMetaClass([NSStringFromClass(klass) UTF8String]), selector, implementation, method_getTypeEncoding(originalMethod)); -} - static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) { NSMutableString *string = [NSMutableString string]; @@ -96,6 +90,12 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) { return string; } +static void AFSwizzleClassMethodWithClassAndSelectorUsingBlock(Class klass, SEL selector, id block) { + Method originalMethod = class_getClassMethod(klass, selector); + IMP implementation = imp_implementationWithBlock((AF_CAST_TO_BLOCK)block); + class_replaceMethod(objc_getMetaClass([NSStringFromClass(klass) UTF8String]), selector, implementation, method_getTypeEncoding(originalMethod)); +} + #pragma mark - @interface AFHTTPRequestOperation ()