






#import "KilobytesPagerButton.h"
#import "DidTodayWax.h"
#import "UIImage+BinImage.h"
#import "WalkFatHueHueController.h"
#import "UIImage+BinImage.h"
#import "UIColor+OddColor.h"

@implementation KilobytesPagerButton

- (instancetype)initSignalAlignViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.playValueAgeViewController = viewController;
        [self barSegueAppleMatrixTickets];
    }
    return self;
}


- (void)barSegueAppleMatrixTickets {
    
    NSArray *commitAnyKoreanArcadeUnit = [SafariTailButtonsRightDefine privilegeTenCousinBrokenSpectral:[EggSpaSink class]];
    
    
    NSString *eachOurFlatOurCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block EggSpaSink *entityMillDust = nil;
    [commitAnyKoreanArcadeUnit enumerateObjectsUsingBlock:^(EggSpaSink *country, NSUInteger idx, BOOL *stop) {
        if ([country.useInfoWidthCode caseInsensitiveCompare:eachOurFlatOurCode] == NSOrderedSame) {
            entityMillDust = country;
            *stop = YES; 
        }
    }];
    self.potassiumWidgetHitHangYou = entityMillDust;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",DidTodayWax.invitePencil.waistPrevious, entityMillDust.addressesCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *pressHitImage = [UIImage preserveSexItsMaskEffortName:DidTodayWax.invitePencil.irregularAccessoryOldestWasEarlyMegabytes];
    
    
    CGSize maxDitheredSize = CGSizeMake(13, 13); 
    
    
    UIImage *sliderImage = [self leaseFlowSoundImage:pressHitImage suchBestSize:maxDitheredSize];
    
    
    [self setImage:sliderImage forState:UIControlStateNormal];
    [self setImage:[sliderImage 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 hitLoopLoopCupColor:[DidTodayWax.mightLeftColor warningSolidLinearPacketsCompoundCloud:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage hitLoopLoopCupColor:[[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(lookHostSawClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)leaseFlowSoundImage:(UIImage *)image suchBestSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat cacheAcute = targetSize.width / image.size.width;
    CGFloat featuredZip = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(cacheAcute, featuredZip);
    
    
    CGRect earBadRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - earBadRect.size.width) / 2.0,
                               (targetSize.height - earBadRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                earBadRect.size.width,
                                earBadRect.size.height)];
    
    UIImage *sobImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return sobImage;
}


- (void)lookHostSawClicked {
    PlaceAskDefineChangeIncludingExecutingViewController *kin = [PlaceAskDefineChangeIncludingExecutingViewController new];
    kin.synthesisDelegate = self;
    [self.playValueAgeViewController.navigationController pushViewController:kin animated:NO];
}

- (void)assetRegionBlindingMountedAndNetworkSpringFifteen:(EggSpaSink *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",DidTodayWax.invitePencil.waistPrevious, country.addressesCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.potassiumWidgetHitHangYou = country;
}

- (void)dealloc {
    
}
@end
