






#import "OutPutTatarButton.h"
#import "TextualTemp.h"
#import "UIImage+GetImage.h"
#import "SDWebImageManager.h"

@interface OutPutTatarButton ()


@property (nonatomic, strong) NSTimer *sunTorchMapItsTimer;

@property (nonatomic, assign) NSInteger trialUnionHealthOldDeferringDithered;

@property (nonatomic, copy) NSString *andFinderFrequencyFarthestDownhill;

@end

@implementation OutPutTatarButton

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

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


- (void)holdHighRearRecycleTouch {
    
    self.bothPackBitsInitialCopperWide = 60;
    self.andFinderFrequencyFarthestDownhill = TextualTemp.mindSnowHeader.pickerRematchMattingIndoorNeedGenericsCode;
    [self setTitle:self.andFinderFrequencyFarthestDownhill forState:UIControlStateNormal];

    
    NSString *moreTipCapOpt = [TextualTemp orderClockHitSlowDayImage];
    if (moreTipCapOpt) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:moreTipCapOpt]
                                                    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 penVowelOwnTryColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage penVowelOwnTryColor:TextualTemp.longBoostColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage penVowelOwnTryColor:TextualTemp.longBoostColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage penVowelOwnTryColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)carChecksumClicked {
    [self phoneticSignalingHisBuildOld];
    if (self.certBoyfriendAction) {
        self.certBoyfriendAction();
    }
}


- (void)phoneticSignalingHisBuildOld {
    self.enabled = NO;
    self.trialUnionHealthOldDeferringDithered = self.bothPackBitsInitialCopperWide;
    [self nameStaySonAskBitEncoding];
    
    
    self.sunTorchMapItsTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(splitMotionSpectralListenerFigure:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)splitMotionSpectralListenerFigure:(NSTimer *)sense {
    self.trialUnionHealthOldDeferringDithered--;
    if (self.trialUnionHealthOldDeferringDithered <= 0) {
        [self featYoungerAbortPinchPost];
    } else {
        [self nameStaySonAskBitEncoding];
    }
}


- (void)nameStaySonAskBitEncoding {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",TextualTemp.mindSnowHeader.creatorNarrativePurpleFutureReloadLeftCode, (long)self.trialUnionHealthOldDeferringDithered];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)featYoungerAbortPinchPost {
    [self.sunTorchMapItsTimer invalidate];
    self.sunTorchMapItsTimer = nil;
    self.enabled = YES;
    [self setTitle:self.andFinderFrequencyFarthestDownhill forState:UIControlStateNormal];
}

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

@end
