






#import "PrefersBetweenButton.h"
#import "AffectedBus.h"
#import "UIImage+LawImage.h"
#import "EyeKitCertMixController.h"
#import "UIImage+LawImage.h"
#import "UIColor+SobColor.h"

@implementation PrefersBetweenButton

- (instancetype)initLeakyInvertViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.napPrologPenViewController = viewController;
        [self networkLayoutBoxSelectionInterrupt];
    }
    return self;
}


- (void)networkLayoutBoxSelectionInterrupt {
    
    NSArray *askArmPoolFinishScene = [PinkIndigoEarFaceIncrement detachingDetachBitViolationMutations:[WillUnwrap class]];
    
    
    NSString *pushIgnoreListCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block WillUnwrap *timeTempButton = nil;
    [askArmPoolFinishScene enumerateObjectsUsingBlock:^(WillUnwrap *country, NSUInteger idx, BOOL *stop) {
        if ([country.keyArtPrefixCode caseInsensitiveCompare:pushIgnoreListCode] == NSOrderedSame) {
            timeTempButton = country;
            *stop = YES; 
        }
    }];
    self.provinceNumberIgnoreDescendScanned = timeTempButton;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",AffectedBus.mixProviders.faxGenreBound, timeTempButton.planarOutCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *beginPenImage = [UIImage softnessTableProtectedDisablesChunkyName:AffectedBus.mixProviders.useSpatialToolRootPhaseOptical];
    
    
    CGSize saySubSmileSize = CGSizeMake(13, 13); 
    
    
    UIImage *actualImage = [self fractionDomainImage:beginPenImage stopOverSize:saySubSmileSize];
    
    
    [self setImage:actualImage forState:UIControlStateNormal];
    [self setImage:[actualImage 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 multiplyPersonColor:[AffectedBus.betterWhoColor buildNumberParagraphUniformSearchingBlinding:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage multiplyPersonColor:[[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(pubMajorOddClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)fractionDomainImage:(UIImage *)image stopOverSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat laotianSob = targetSize.width / image.size.width;
    CGFloat callMileArt = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(laotianSob, callMileArt);
    
    
    CGRect forAgeRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - forAgeRect.size.width) / 2.0,
                               (targetSize.height - forAgeRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                forAgeRect.size.width,
                                forAgeRect.size.height)];
    
    UIImage *busImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return busImage;
}


- (void)pubMajorOddClicked {
    NumberKelvinGraphicsDefaultWateryShoulderViewController *sex = [NumberKelvinGraphicsDefaultWateryShoulderViewController new];
    sex.sexualHasDelegate = self;
    [self.napPrologPenViewController.navigationController pushViewController:sex animated:NO];
}

- (void)winClinicalWithTagSubFormEqualitySaw:(WillUnwrap *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",AffectedBus.mixProviders.faxGenreBound, country.planarOutCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.provinceNumberIgnoreDescendScanned = country;
}

- (void)dealloc {
    
}
@end
