LineSDKJSONWebToken+RawString的副本.m 765 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // LineSDKJSONWebToken+RawString.m
  3. // TYSocialLine
  4. //
  5. // Created by JiaNa on 2021/1/21.
  6. //
  7. #import "LineSDKJSONWebToken+RawString.h"
  8. #import <TYFoundationKit/NSObject+TYSwizzle.h>
  9. #import <TYFoundationKit/NSObject+TYAssociate.h>
  10. @implementation LineSDKJSONWebToken (RawString)
  11. + (void)load {
  12. static dispatch_once_t onceToken;
  13. dispatch_once(&onceToken, ^{
  14. [self ty_swizzleInstanceMethod:@selector(initWithString:) with:@selector(ty_initWithString:)];
  15. });
  16. }
  17. - (instancetype)ty_initWithString:(NSString *)string {
  18. id instance = [self ty_initWithString:string];
  19. [instance ty_setAssociate:string withKey:@"rawString"];
  20. return instance;
  21. }
  22. - (NSString *)rawString {
  23. return [self ty_getAssociateWithKey:@"rawString"];
  24. }
  25. @end