






#import "PartlyVitalButton.h"
#import "RuleListCut.h"
#import "UIImage+HasImage.h"
#import "SDWebImageManager.h"

@interface PartlyVitalButton ()


@property (nonatomic, strong) NSTimer *hisMixReadyFarTimer;

@property (nonatomic, assign) NSInteger busLocalesResourcesTabLemmaMicro;

@property (nonatomic, copy) NSString *parameterCancelsMicroSomaliHandoff;

@end

@implementation PartlyVitalButton

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

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


- (void)audienceReportsBirthdaySheGopher {
    
    self.wonBitsListenSolidPublisherTemplate = 60;
    self.parameterCancelsMicroSomaliHandoff = RuleListCut.costSonKnowKit.authorGreatNumeralExceededFactoryCompressCode;
    [self setTitle:self.parameterCancelsMicroSomaliHandoff forState:UIControlStateNormal];

    
    NSString *peerCarLawUse = [RuleListCut smoothTeacherAnswerToleranceOriginalImage];
    if (peerCarLawUse) {
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:peerCarLawUse]
                                                    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 fitRunHoursAllColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
                });
            }
        }];
        
        [self setBackgroundImage:[UIImage fitRunHoursAllColor:RuleListCut.slopeLockColor] forState:UIControlStateNormal];
    } else {
        
        [self setBackgroundImage:[UIImage fitRunHoursAllColor:RuleListCut.slopeLockColor] forState:UIControlStateNormal];
        [self setBackgroundImage:[UIImage fitRunHoursAllColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateHighlighted];
    }

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

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


- (void)airBadLeaseClicked {
    [self playbackStepsonBoldDrawValidity];
    if (self.wetAreaRowTipAction) {
        self.wetAreaRowTipAction();
    }
}


- (void)playbackStepsonBoldDrawValidity {
    self.enabled = NO;
    self.busLocalesResourcesTabLemmaMicro = self.wonBitsListenSolidPublisherTemplate;
    [self strokeAdjectiveWaxRefinedEffortYard];
    
    
    self.hisMixReadyFarTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(moduleOvulationQuitDisorderHair:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)moduleOvulationQuitDisorderHair:(NSTimer *)small {
    self.busLocalesResourcesTabLemmaMicro--;
    if (self.busLocalesResourcesTabLemmaMicro <= 0) {
        [self binSchemePortionAboutPort];
    } else {
        [self strokeAdjectiveWaxRefinedEffortYard];
    }
}


- (void)strokeAdjectiveWaxRefinedEffortYard {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",RuleListCut.costSonKnowKit.newtonsEncodeDetectedNodeCleanupPreparedCode, (long)self.busLocalesResourcesTabLemmaMicro];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)binSchemePortionAboutPort {
    [self.hisMixReadyFarTimer invalidate];
    self.hisMixReadyFarTimer = nil;
    self.enabled = YES;
    [self setTitle:self.parameterCancelsMicroSomaliHandoff forState:UIControlStateNormal];
}

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

@end
