解决了语音上传到问题,接下来要解决下载播放问题
This commit is contained in:
63
Pods/Qiniu/QiniuSDK/Utils/NSObject+QNSwizzle.m
generated
Normal file
63
Pods/Qiniu/QiniuSDK/Utils/NSObject+QNSwizzle.m
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// NSObject+QNSwizzle.m
|
||||
// HappyDNS
|
||||
//
|
||||
// Created by yangsen on 2020/4/13.
|
||||
//
|
||||
|
||||
#import "NSObject+QNSwizzle.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
@implementation NSObject(QNSwizzle)
|
||||
|
||||
+ (BOOL)qn_swizzleInstanceMethodsOfSelectorA:(SEL)selectorA
|
||||
selectorB:(SEL)selectorB{
|
||||
|
||||
Method methodA = class_getInstanceMethod(self, selectorA);
|
||||
Method methodB = class_getInstanceMethod(self, selectorB);
|
||||
if (!methodA || !methodB) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
class_addMethod(self,
|
||||
selectorA,
|
||||
class_getMethodImplementation(self, selectorA),
|
||||
method_getTypeEncoding(methodA));
|
||||
|
||||
class_addMethod(self,
|
||||
selectorB,
|
||||
class_getMethodImplementation(self, selectorB),
|
||||
method_getTypeEncoding(methodB));
|
||||
|
||||
method_exchangeImplementations(class_getInstanceMethod(self, selectorA),
|
||||
class_getInstanceMethod(self, selectorB));
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
+ (BOOL)qn_swizzleClassMethodsOfSelectorA:(SEL)selectorA
|
||||
selectorB:(SEL)selectorB{
|
||||
|
||||
Method methodA = class_getInstanceMethod(object_getClass(self), selectorA);
|
||||
Method methodB = class_getInstanceMethod(object_getClass(self), selectorB);
|
||||
if (!methodA || !methodB) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
class_addMethod(self,
|
||||
selectorA,
|
||||
class_getMethodImplementation(self, selectorA),
|
||||
method_getTypeEncoding(methodA));
|
||||
|
||||
class_addMethod(self,
|
||||
selectorB,
|
||||
class_getMethodImplementation(self, selectorB),
|
||||
method_getTypeEncoding(methodB));
|
||||
|
||||
method_exchangeImplementations(class_getInstanceMethod(self, selectorA),
|
||||
class_getInstanceMethod(self, selectorB));
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user