






#import "ThinRetIllRestButton.h"
#import "WinNeedHang.h"
#import "UIImage+EggImage.h"
#import "ElevationBestController.h"
#import "UIImage+EggImage.h"
#import "UIColor+LowColor.h"

@implementation ThinRetIllRestButton

- (instancetype)initLowEmailTopViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.sinAllocatedViewController = viewController;
        [self squaresNotBedFrequencyBezel];
    }
    return self;
}


- (void)squaresNotBedFrequencyBezel {
    
    NSArray *containInfoJoiningAcrossPeriod = [VisionEastProjectLocalityLocales balancedGatewaysSmartEnteredEligible:[ClearFirst class]];
    
    
    NSString *realmPanMixKeyCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block ClearFirst *mixWaxAboutCar = nil;
    [containInfoJoiningAcrossPeriod enumerateObjectsUsingBlock:^(ClearFirst *country, NSUInteger idx, BOOL *stop) {
        if ([country.illPubDeviceCode caseInsensitiveCompare:realmPanMixKeyCode] == NSOrderedSame) {
            mixWaxAboutCar = country;
            *stop = YES; 
        }
    }];
    self.alongInheritedMethodKindQueue = mixWaxAboutCar;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",WinNeedHang.chargePenSin.photoManySeek, mixWaxAboutCar.passivelyCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *allTrialImage = [UIImage rearrangeKeepCutterAbsentBalancedName:WinNeedHang.chargePenSin.tableDetailedOutPaddleSubgroupsFat];
    
    
    CGSize disableBookSize = CGSizeMake(13, 13); 
    
    
    UIImage *absentImage = [self subIconAskLateImage:allTrialImage partRowsSize:disableBookSize];
    
    
    [self setImage:absentImage forState:UIControlStateNormal];
    [self setImage:[absentImage 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 capMidDelayAirColor:[WinNeedHang.suspendedColor unwindingSunMaintainExpansionBouncingHandball:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage capMidDelayAirColor:[[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(photoFitRowClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)subIconAskLateImage:(UIImage *)image partRowsSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat pathOption = targetSize.width / image.size.width;
    CGFloat hormoneCard = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(pathOption, hormoneCard);
    
    
    CGRect retManRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - retManRect.size.width) / 2.0,
                               (targetSize.height - retManRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                retManRect.size.width,
                                retManRect.size.height)];
    
    UIImage *youImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return youImage;
}


- (void)photoFitRowClicked {
    MandatorySonAspectOccurSandboxReturnedViewController *bit = [MandatorySonAspectOccurSandboxReturnedViewController new];
    bit.subscribeDelegate = self;
    [self.sinAllocatedViewController.navigationController pushViewController:bit animated:NO];
}

- (void)succeedTrailingTruncatesPetabytesDefinesFormatsSymbolTelephoto:(ClearFirst *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",WinNeedHang.chargePenSin.photoManySeek, country.passivelyCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.alongInheritedMethodKindQueue = country;
}

- (void)dealloc {
    
}
@end
