






#import "IronSawYouSideButton.h"
#import "FixMaterial.h"
#import "UIImage+TryImage.h"
#import "SongIcyRowYetController.h"
#import "UIImage+TryImage.h"
#import "UIColor+BitColor.h"

@implementation IronSawYouSideButton

- (instancetype)initWrappingTooViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.digitWritingViewController = viewController;
        [self wristTempThermalPrecisionNotify];
    }
    return self;
}


- (void)wristTempThermalPrecisionNotify {
    
    NSArray *solvePhoneticTallCricketInterval = [ContainsResumedMenGeneratorNext routeBoxRedirectLongOwn:[HitArtSolo class]];
    
    
    NSString *zoneIndoorDaysCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block HitArtSolo *seePlanPlayLaw = nil;
    [solvePhoneticTallCricketInterval enumerateObjectsUsingBlock:^(HitArtSolo *country, NSUInteger idx, BOOL *stop) {
        if ([country.yetAwayExitsCode caseInsensitiveCompare:zoneIndoorDaysCode] == NSOrderedSame) {
            seePlanPlayLaw = country;
            *stop = YES; 
        }
    }];
    self.combiningGopherClinicalColoredManager = seePlanPlayLaw;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",FixMaterial.capsLoopsAge.oneVirtualSin, seePlanPlayLaw.signalingCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *trialCapImage = [UIImage tabularFinishAudiencesKinTriggeredName:FixMaterial.capsLoopsAge.kitWaterBoyfriendCapacityAngularTagalog];
    
    
    CGSize hasOverhangSize = CGSizeMake(13, 13); 
    
    
    UIImage *minuteImage = [self floatSumHerSheImage:trialCapImage firstHexSize:hasOverhangSize];
    
    
    [self setImage:minuteImage forState:UIControlStateNormal];
    [self setImage:[minuteImage 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 narrativeLinerColor:[FixMaterial.beforeArtColor mildNodeSquashRestVolatileRole:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage narrativeLinerColor:[[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(directlyRetClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)floatSumHerSheImage:(UIImage *)image firstHexSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat sobNineAre = targetSize.width / image.size.width;
    CGFloat didArtJoule = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(sobNineAre, didArtJoule);
    
    
    CGRect useTopRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - useTopRect.size.width) / 2.0,
                               (targetSize.height - useTopRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                useTopRect.size.width,
                                useTopRect.size.height)];
    
    UIImage *outImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return outImage;
}


- (void)directlyRetClicked {
    DiacriticCandidateWorldTraitAdditiveAgeViewController *fit = [DiacriticCandidateWorldTraitAdditiveAgeViewController new];
    fit.iterativeDelegate = self;
    [self.digitWritingViewController.navigationController pushViewController:fit animated:NO];
}

- (void)broadcastArmBracketMillionDatumPulseThreadsHello:(HitArtSolo *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",FixMaterial.capsLoopsAge.oneVirtualSin, country.signalingCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.combiningGopherClinicalColoredManager = country;
}

- (void)dealloc {
    
}
@end
