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