

#import "ItsStartupView.h"
#import "BedNotMayColorCell.h"
#import "UIImageView+WebCache.h"
#import "UIView+WebCache.h"

@interface ItsStartupView ()
@property (nonatomic, strong) UIImageView *alphaSideSuchImageView;
@end

@implementation ItsStartupView

- (void)thickSubmittedEquallyAreItsPoolModel:(CutRenameKitInfo *)model {

    NSMutableArray *basal = [NSMutableArray new];
    for (int i = 0; i<model.opaqueCost; i++) {
        BedNotMayColorCell *pack = [[BedNotMayColorCell alloc]init];
        pack.edgaAudioKit = model.amountCell;
        pack.channelCount = 1;
        pack.howWon = 6;
        pack.twoAlertGetDog = CGFLOAT_MIN;
        CGRect pongRect = [model.pivotEntries boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:model.teamProcessSyntheticTagPopFax] forKey:NSFontAttributeName] context:nil];
        pack.useSwapSize = CGSizeMake(pongRect.size.width+8, pongRect.size.height+4);
        pack.model = model;
        [basal addObject:pack];
    }
    [self pinkFileSoccer:basal];
}

- (void)summariesDeliveredShowersDeliveredUnlockedHexPoolModel:(CutRenameKitInfo *)model {
    NSString *url = model.geometricPoliciesVisitDeletingInterAccount;

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

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

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

- (void)ownBoxBinPartImageView:(UIImageView *)spa image:(UIImage *)image {
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    if (image.size.width > 0) {
        CGFloat alphaUses = image.size.height / image.size.width * width;
        
        CGFloat seeLine = (height - alphaUses) * 0.5;
        spa.frame = CGRectMake(0, seeLine, width, alphaUses);
    } else {
        spa.frame = self.bounds;
    }
}

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


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

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

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

@end
