






#import "GroupedNetworkButton.h"
#import "SobIllWelsh.h"
#import "UIImage+DogImage.h"
#import "FoggyLeakyBagController.h"
#import "UIImage+DogImage.h"
#import "UIColor+WasColor.h"

@implementation GroupedNetworkButton

- (instancetype)initRoomDidFaceViewController:(UIViewController *)viewController {
    self = [super init];
    if (self) {
        self.maskDurationViewController = viewController;
        [self magnesiumFileEnhanceBloodCousin];
    }
    return self;
}


- (void)magnesiumFileEnhanceBloodCousin {
    
    NSArray *reviewPutBatteryTeamDiastolic = [KilowattsAwayTenFlagMid makeMealDashLayerExpired:[PhotoSlope class]];
    
    
    NSString *beenArtCanWarpCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    __block PhotoSlope *foldYetSentSub = nil;
    [reviewPutBatteryTeamDiastolic enumerateObjectsUsingBlock:^(PhotoSlope *country, NSUInteger idx, BOOL *stop) {
        if ([country.expectRowKitCode caseInsensitiveCompare:beenArtCanWarpCode] == NSOrderedSame) {
            foldYetSentSub = country;
            *stop = YES; 
        }
    }];
    self.distantLaterGrammarNaturalKit = foldYetSentSub;
    
    
    NSString *title = [NSString stringWithFormat:@"%@%@",SobIllWelsh.followBigKit.zipGetKitLike, foldYetSentSub.locationsCode];
    [self setTitle:title forState:UIControlStateNormal];
    
    
    UIImage *speakDueImage = [UIImage loveObserveBestAxesFitName:SobIllWelsh.followBigKit.lappishLawCapWetUniversalMeal];
    
    
    CGSize strengthHitSize = CGSizeMake(13, 13); 
    
    
    UIImage *wonOffImage = [self sawHueWrapPeakImage:speakDueImage subTokenSize:strengthHitSize];
    
    
    [self setImage:wonOffImage forState:UIControlStateNormal];
    [self setImage:[wonOffImage 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 manyHeavyForceColor:[SobIllWelsh.itemQuickColor lightFilmDictationResizingScriptAltitude:8]] forState:UIControlStateNormal];
    [self setBackgroundImage:[UIImage manyHeavyForceColor:[[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(variableArmClicked) forControlEvents:UIControlEventTouchUpInside];
}


- (UIImage *)sawHueWrapPeakImage:(UIImage *)image subTokenSize:(CGSize)targetSize {
    
    UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
    
    
    CGFloat watchBezel = targetSize.width / image.size.width;
    CGFloat wetDogBevel = targetSize.height / image.size.height;
    CGFloat scaleFactor = MIN(watchBezel, wetDogBevel);
    
    
    CGRect pascalRect = CGRectMake(0, 0,
                                  image.size.width * scaleFactor,
                                  image.size.height * scaleFactor);
    
    
    CGPoint origin = CGPointMake((targetSize.width - pascalRect.size.width) / 2.0,
                               (targetSize.height - pascalRect.size.height) / 2.0);
    [image drawInRect:CGRectMake(origin.x, origin.y,
                                pascalRect.size.width,
                                pascalRect.size.height)];
    
    UIImage *waxImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return waxImage;
}


- (void)variableArmClicked {
    KindInterruptWasHeaderKurdishAnimatingViewController *box = [KindInterruptWasHeaderKurdishAnimatingViewController new];
    box.sayNegateDelegate = self;
    [self.maskDurationViewController.navigationController pushViewController:box animated:NO];
}

- (void)confirmDecideEntityLimitedSpringQuitSongHome:(PhotoSlope *)country {
    NSString *title = [NSString stringWithFormat:@"%@%@",SobIllWelsh.followBigKit.zipGetKitLike, country.locationsCode];
    [self setTitle:title forState:UIControlStateNormal];
    self.distantLaterGrammarNaturalKit = country;
}

- (void)dealloc {
    
}
@end
