

#import "SentEndAgeView.h"
#import "WaxStoodHasTabCell.h"
#import "UIImageView+WebCache.h"
#import "UIView+WebCache.h"

@interface SentEndAgeView ()
@property (nonatomic, strong) UIImageView *quantizeMountImageView;
@end

@implementation SentEndAgeView

- (void)prettyAddressProminentHowJobFitModel:(TooSoftSmartInfo *)model {

    NSMutableArray *renew = [NSMutableArray new];
    for (int i = 0; i<model.acquireOff; i++) {
        WaxStoodHasTabCell *past = [[WaxStoodHasTabCell alloc]init];
        past.strideBorder = model.nowAllLook;
        past.channelCount = 1;
        past.anyAnd = 6;
        past.invokeWireSent = CGFLOAT_MIN;
        CGRect slowRect = [model.pinFullyMail boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:model.updateStoreTwoEighteenBondCoalesce] forKey:NSFontAttributeName] context:nil];
        past.carRareSize = CGSizeMake(slowRect.size.width+8, slowRect.size.height+4);
        past.model = model;
        [renew addObject:past];
    }
    [self bouncingPrefer:renew];
}

- (void)burnUpscaleTrimmingQualifiedArmClippingWithModel:(TooSoftSmartInfo *)model {
    NSString *url = model.bookPassAmharicCanLocalesToggle;

    if (url.length == 0) {
        _quantizeMountImageView.hidden = YES;
        _quantizeMountImageView.image = nil;
        return;
    }

    UIImageView *wax = self.quantizeMountImageView;
    wax.hidden = NO;
    if (wax.superview != self) {
        [self insertSubview:wax atIndex:0];
    } else {
        [self sendSubviewToBack:wax];
    }

    [wax sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        if (image) [self familyHyphensImageView:wax image:image];
    }];
}

- (void)familyHyphensImageView:(UIImageView *)wax image:(UIImage *)image {
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    if (image.size.width > 0) {
        CGFloat sumAscent = image.size.height / image.size.width * width;
        
        CGFloat lockEgg = (height - sumAscent) * 0.5;
        wax.frame = CGRectMake(0, lockEgg, width, sumAscent);
    } else {
        wax.frame = self.bounds;
    }
}

- (UIImageView *)quantizeMountImageView {
    if (!_quantizeMountImageView) {
        _quantizeMountImageView = [[UIImageView alloc] init];
        _quantizeMountImageView.contentMode = UIViewContentModeScaleToFill;
        _quantizeMountImageView.userInteractionEnabled = NO;
        _quantizeMountImageView.clipsToBounds = NO;
    }
    return _quantizeMountImageView;
}


- (void)copperPrimaryBrownCacheDesktopGenerate {
    if (_quantizeMountImageView) {
        [_quantizeMountImageView sd_cancelLatestImageLoad];
        [_quantizeMountImageView removeFromSuperview];
        _quantizeMountImageView.image = nil;
        _quantizeMountImageView = nil;
    }
}

- (void)stop {
    [super stop];
    [self copperPrimaryBrownCacheDesktopGenerate];
}

- (void)removeFromSuperview {
    [self copperPrimaryBrownCacheDesktopGenerate];
    [super removeFromSuperview];
}

@end
