SGQRCodeLog.m 745 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // SGQRCodeLog.m
  3. // SGQRCodeExample
  4. //
  5. // Created by kingsic on 2022/7/15.
  6. // Copyright © 2022 kingsic. All rights reserved.
  7. //
  8. #import "SGQRCodeLog.h"
  9. static SGQRCodeLog *singleton = nil;
  10. @implementation SGQRCodeLog
  11. + (instancetype)sharedQRCodeLog {
  12. static dispatch_once_t onceToken;
  13. dispatch_once(&onceToken, ^{
  14. if (singleton == nil) {
  15. singleton = [[super allocWithZone:NULL] init];
  16. }
  17. });
  18. return singleton;
  19. }
  20. + (instancetype)allocWithZone:(struct _NSZone *)zone {
  21. return [[self class] sharedQRCodeLog];
  22. }
  23. - (id)copyWithZone:(NSZone *)zone {
  24. return [[self class] sharedQRCodeLog];
  25. }
  26. - (id)mutableCopyWithZone:(NSZone *)zone {
  27. return [[self class] sharedQRCodeLog];
  28. }
  29. @end