






#import "NotThousandButton.h"
#import "RedFlexible.h"
#import "UIImage+DryImage.h"
#import "SDWebImageManager.h"

@interface NotThousandButton ()


@property (nonatomic, strong) NSTimer *holdRatioEveryTimer;

@property (nonatomic, assign) NSInteger streetTwoCornerScanLowLocal;

@property (nonatomic, copy) NSString *seeAltimeterOceanSixToo;

@end

@implementation NotThousandButton

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self farFinishCloudFunctionNiacin];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
    self = [super initWithCoder:coder];
    if (self) {
        [self farFinishCloudFunctionNiacin];
    }
    return self;
}


- (void)farFinishCloudFunctionNiacin {
    
    self.subtitlesVisitorSquaresReferentSumTap = 60;
    self.seeAltimeterOceanSixToo = RedFlexible.daySentFaxWill.tenRestFixCiphersHangDenyCode;
    [self setTitle:self.seeAltimeterOceanSixToo forState:UIControlStateNormal];

    
    NSString *iodineSpanish = [RedFlexible attributeAssemblyPetabytesProvisionTailImage];
    if (iodineSpanish) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:iodineSpanish]
                                                    options:0
                                                   progress:nil
                                                  completed:^(UIImage *image, NSData *data, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
            if (image) {
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self setBackgroundImage:image forState:UIControlStateNormal];
                    [self setBackgroundImage:[UIImage gregorianStandColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage gregorianStandColor:RedFlexible.northTextColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage gregorianStandColor:RedFlexible.northTextColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage gregorianStandColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = RedFlexible.capContinued.schemeSearch;
    self.layer.masksToBounds = YES;
    
    self.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
    
    [self sizeToFit];

    
    [self addTarget:self action:@selector(fitDigitSeeClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)fitDigitSeeClicked {
    [self userIntentsAllPatternsSharing];
    if (self.hisSunNowLiftAction) {
        self.hisSunNowLiftAction();
    }
}


- (void)userIntentsAllPatternsSharing {
    self.enabled = NO;
    self.streetTwoCornerScanLowLocal = self.subtitlesVisitorSquaresReferentSumTap;
    [self appendNegateStructureExchangesAcquireFree];
    
    
    self.holdRatioEveryTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(cursorsSchedulerGeneratesSquashOver:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)cursorsSchedulerGeneratesSquashOver:(NSTimer *)photo {
    self.streetTwoCornerScanLowLocal--;
    if (self.streetTwoCornerScanLowLocal <= 0) {
        [self forContentContainPositiveSymmetric];
    } else {
        [self appendNegateStructureExchangesAcquireFree];
    }
}


- (void)appendNegateStructureExchangesAcquireFree {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",RedFlexible.daySentFaxWill.unsignedMidThreeStorylineBurmeseRetCode, (long)self.streetTwoCornerScanLowLocal];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)forContentContainPositiveSymmetric {
    [self.holdRatioEveryTimer invalidate];
    self.holdRatioEveryTimer = nil;
    self.enabled = YES;
    [self setTitle:self.seeAltimeterOceanSixToo forState:UIControlStateNormal];
}

- (void)dealloc {
    
    [self.holdRatioEveryTimer invalidate];
    self.holdRatioEveryTimer = nil;
}

@end
