






#import "OnlineColorButton.h"
#import "FeedSunTied.h"
#import "UIImage+FitImage.h"

@interface OnlineColorButton ()


@property (nonatomic, strong) NSTimer *autoEnableMaleTimer;

@property (nonatomic, assign) NSInteger mileHostSlidingPhotosConstantBed;

@property (nonatomic, copy) NSString *ninePubInteriorAirMotion;

@end

@implementation OnlineColorButton

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

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


- (void)wayViewTapTaggingPhrase {
    
    self.escapedOurClimbingPenRecordAnonymous = 60;
    self.ninePubInteriorAirMotion = FeedSunTied.switchEnvelope.searchingPositionsInsteadReplacedAppearsRankedCode;
    [self setTitle:self.ninePubInteriorAirMotion forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage cutoffTeamHintColor:FeedSunTied.activeBigColor] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage cutoffTeamHintColor:[[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(redoneClampClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (void)redoneClampClicked {
    [self cleanupAllocateMouthEllipseElectric];
    if (self.warnMovieTeamAction) {
        self.warnMovieTeamAction();
    }
}


- (void)cleanupAllocateMouthEllipseElectric {
    self.enabled = NO;
    self.mileHostSlidingPhotosConstantBed = self.escapedOurClimbingPenRecordAnonymous;
    [self schemeDegreesConverterCropCatalystAvail];
    
    
    self.autoEnableMaleTimer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                                                 target:self
                                                               selector:@selector(excludedSmoothWaistMouthBin:)
                                                               userInfo:nil
                                                                repeats:YES];
}


- (void)excludedSmoothWaistMouthBin:(NSTimer *)spell {
    self.mileHostSlidingPhotosConstantBed--;
    if (self.mileHostSlidingPhotosConstantBed <= 0) {
        [self mergeNepaliFadeOptPascal];
    } else {
        [self schemeDegreesConverterCropCatalystAvail];
    }
}


- (void)schemeDegreesConverterCropCatalystAvail {
    NSString *title = [NSString stringWithFormat:@"%@(%ld)",FeedSunTied.switchEnvelope.simpleFractionAlbanianUnboundedExplicitFilenamesCode, (long)self.mileHostSlidingPhotosConstantBed];
    [self setTitle:title forState:UIControlStateDisabled];
}


- (void)mergeNepaliFadeOptPascal {
    [self.autoEnableMaleTimer invalidate];
    self.autoEnableMaleTimer = nil;
    self.enabled = YES;
    [self setTitle:self.ninePubInteriorAirMotion forState:UIControlStateNormal];
}

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

@end
