






#import "ExpiredSchemesButton.h"
#import "FeedSunTied.h"
#import "UIImage+FitImage.h"
#import "SubBoxCascadeController.h"
#import "UIImage+FitImage.h"
#import "UIColor+NetColor.h"

@implementation ExpiredSchemesButton

- (instancetype)initSongKinRuleViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.lossyLighterViewController = viewController;
        [self wayViewTapTaggingPhrase];
    }
    return self;
}


- (void)wayViewTapTaggingPhrase {
    
    NSArray *cupJobDitherGenericExponent = [KilogramsFaxDaughtersBeaconsSix contrastFarEnglishDemandTruncated:[BedNeedBox class]];
    
    
    NSString *millRaceMayEggCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block BedNeedBox *darkUnitPenFun = nil;
    [cupJobDitherGenericExponent enumerateObjectsUsingBlock:^(BedNeedBox *country, NSUInteger idx, BOOL *stop) {
        if ([country.shutterSceneCode caseInsensitiveCompare:millRaceMayEggCode] == NSOrderedSame) {
            darkUnitPenFun = country;
            *stop = YES; 
        }
    }];
    self.eraDecomposeQuietRelativeFeature = darkUnitPenFun;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",FeedSunTied.rootIntegral.longPipeSound, darkUnitPenFun.fatFactorCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *outDanceImage = [UIImage upsideJouleAssistantTraverseShakeName:FeedSunTied.rootIntegral.springBengaliIcyBurnShowExclusion];
    
    
    CGSize taggingPoolSize = CGSizeMake(13, 13); 
    
    
    UIImage *outRunImage = [self sigmaRadixPairImage:outDanceImage dueTrustSize:taggingPoolSize];
    
    
    [self setImage:outRunImage forState:UIControlStateNormal];
    [self setImage:[outRunImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateHighlighted]; 
    
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    
    
    self.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; 
    CGFloat spacing = 3.0; 
    self.imageEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);  
    self.titleEdgeInsets = UIEdgeInsetsMake(0, -spacing, 0, spacing);   
    
    
    [self setBackgroundImage:[UIImage cutoffTeamHintColor:[FeedSunTied.activeBigColor scanBevelAcceptingNumeratorTowerQuotes:8]] 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.maskedCorners = kCALayerMinXMinYCorner | kCALayerMinXMaxYCorner;
    self.layer.masksToBounds = YES;
    
    
    self.contentEdgeInsets = UIEdgeInsetsMake(8, 12, 8, 12); 
    
    
    [self sizeToFit];
    
    
    [self addTarget:self action:@selector(redoneClampClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)sigmaRadixPairImage:(UIImage *)image dueTrustSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat fifteenMid = targetSize.width / image.size.width;
    CGFloat openHostSum = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(fifteenMid, openHostSum);
    
    
    CGRect unwrapRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - unwrapRect.size.width) / 2.0,
                               (targetSize.height - unwrapRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                unwrapRect.size.width,
                                unwrapRect.size.height)];
    
    UIImage *bitImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return bitImage;
}


- (void)redoneClampClicked {
    EdgeThousandsSentenceInsertExtendingMinViewController *did = [EdgeThousandsSentenceInsertExtendingMinViewController new];
    did.busPurpleDelegate = self;
    [self.lossyLighterViewController.navigationController pushViewController:did animated:NO];
}

- (void)fastPrinterCurrentlyTypeLemmaMidSinBox:(BedNeedBox *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",FeedSunTied.rootIntegral.longPipeSound, country.fatFactorCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.eraDecomposeQuietRelativeFeature = country;
}

- (void)dealloc {
    
}
@end
