






#import "SayHertzZipButton.h"
#import "DueIcyFetch.h"
#import "UIImage+IllImage.h"

@interface SayHertzZipButton ()


@property (nonatomic, strong) NSTimer *halfAscentCubeTimer;

@property (nonatomic, assign) NSInteger modalServicesScrollingOutdoorHeapConflicts;

@property (nonatomic, copy) NSString *runDecodingUpscaleStackDue;

@end

@implementation SayHertzZipButton

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

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


- (void)balancedJustifiedCyclingLaotianSock {
    
    self.sliceRowsStandardPhoneticRedNot = 60;
    self.runDecodingUpscaleStackDue = DueIcyFetch.catBaseSinFill.hitProblemFormattedRawRelativeOpenCode;
    [self setTitle:self.runDecodingUpscaleStackDue forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage pinRatioTheMenColor:DueIcyFetch.outPostalColor] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage pinRatioTheMenColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.layer.cornerRadius = 2.f;
    self.layer.masksToBounds = YES;
    
    self.contentEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 5);
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(readerRightClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)readerRightClicked {
    [self imageCardBuiltEntryWas];
    if (self.logItsInvitedAction) {
        self.logItsInvitedAction();
    }
}


- (void)imageCardBuiltEntryWas {
    self.enabled = NO;
    self.modalServicesScrollingOutdoorHeapConflicts = self.sliceRowsStandardPhoneticRedNot;
    [self potentialEncryptCollectSeePairSphere];
    
    
    self.halfAscentCubeTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(verifyMovementTripleHitPatient:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)verifyMovementTripleHitPatient:(NSTimer *)foggy {
    self.modalServicesScrollingOutdoorHeapConflicts--;
    if (self.modalServicesScrollingOutdoorHeapConflicts <= 0) {
        [self desktopLeapAnalysisCatalogElement];
    } else {
        [self potentialEncryptCollectSeePairSphere];
    }
}


- (void)potentialEncryptCollectSeePairSphere {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",DueIcyFetch.catBaseSinFill.cardShakeIronCircleRangeAutoCode, (long)self.modalServicesScrollingOutdoorHeapConflicts];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)desktopLeapAnalysisCatalogElement {
    [self.halfAscentCubeTimer invalidate];
    self.halfAscentCubeTimer = nil;
    self.enabled = YES;
    [self setTitle:self.runDecodingUpscaleStackDue forState:UIControlStateNormal];
}

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

@end
