| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 | ////  KWTextField.m//  westkissMob////  Created by iOS on 2022/9/19.//#import "KWTextField.h"@implementation KWTextField- (instancetype)init {    self = [super init];    if (self) {        [self setStyle];    }    return self;}- (void)setStyle {    self.borderStyle = UITextBorderStyleNone;    self.layer.borderColor = [[UIColor colorWithHexString:@"#000000"] CGColor];    self.layer.borderWidth = 1;    self.layer.cornerRadius = 4;    self.layer.masksToBounds = true;    self.backgroundColor = UIColor.whiteColor;    self.font = [UIFont fontWithName:Rob_Regular size:14];    self.textColor = [UIColor colorWithHexString:@"#0b0b0b"];    self.textAlignment = NSTextAlignmentCenter;}@end@implementation UIView(baseInit)- (void)sleep:(NSTimeInterval)time {    self.userInteractionEnabled = false;    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, time), dispatch_get_main_queue(), ^{        self.userInteractionEnabled = true;    });}- (void)addSubviews:(NSArray <UIView *>*)arr {    for (UIView *temp in arr) {        [self addSubview:temp];    }}// MARK: - base create+ (UIView *)baseV {    UIView *v = [[UIView alloc] init];    v.backgroundColor = UIColor.whiteColor;    return v;}+ (UILabel *)baseLb {    UILabel *lb = [[UILabel alloc] init];    lb.font = [UIFont fontWithName:Rob_Regular size:14];    lb.textColor = [UIColor blackColor];    lb.backgroundColor = [UIColor clearColor];    return lb;}+ (UIImageView *)baseImgV {    UIImageView *imgV = [[UIImageView alloc] init];    imgV.contentMode = UIViewContentModeScaleAspectFit;    return imgV;}+ (UIStackView *)baseStackV:(BOOL)isVertical {    UIStackView *stackV = [[UIStackView alloc] init];    stackV.axis = isVertical ? UILayoutConstraintAxisVertical : UILayoutConstraintAxisHorizontal;    stackV.spacing = 8;    stackV.alignment = UIStackViewAlignmentFill;    stackV.distribution = UIStackViewDistributionFill;    return stackV;}+ (UIImage *)snapshotWithView:(UIView *)view {    UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, [UIScreen mainScreen].scale);    [view.layer renderInContext:UIGraphicsGetCurrentContext()];    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();    UIGraphicsEndImageContext();    return image;}@end
 |