zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
//  SGScanViewConfigure.m
//  SGQRCodeExample
//
//  Created by kingsic on 2022/7/9.
//  Copyright © 2022 kingsic. All rights reserved.
//
 
#import "SGScanViewConfigure.h"
 
@implementation SGScanViewConfigure
 
- (instancetype)init {
    if (self = [super init]) {
        _isShowBorder = NO;
    }
    return self;
}
 
+ (instancetype)configure {
    return [[self alloc] init];
}
 
- (NSString *)scanline {
    if (!_scanline) {
        return @"scan_scanline_wc";
    }
    return _scanline;
}
 
- (CGFloat)scanlineStep {
    if (!_scanlineStep) {
        return 3.5;
    }
    return _scanlineStep;
}
 
- (UIColor *)color {
    if (!_color) {
        return [[UIColor blackColor] colorWithAlphaComponent:0.5];
    }
    return _color;
}
 
- (UIColor *)borderColor {
    if (!_borderColor) {
        return [UIColor whiteColor];
    }
    return _borderColor;
}
 
- (CGFloat)borderWidth {
    if (!_borderWidth) {
        return 0.2;
    }
    return _borderWidth;
}
 
- (SGCornerLoaction)cornerLocation {
    if (!_cornerLocation) {
        return SGCornerLoactionDefault;
    }
    return _cornerLocation;
}
 
- (UIColor *)cornerColor {
    if (!_cornerColor) {
        _cornerColor = [UIColor greenColor];
    }
    return _cornerColor;
}
 
- (CGFloat)cornerWidth {
    if (!_cornerWidth) {
        return 2.0;
    }
    return _cornerWidth;
}
 
- (CGFloat)cornerLength {
    if (!_cornerLength) {
        return 20.0;
    }
    return _cornerLength;
}
 
@end