

#import "SexItsPackView.h"
#import "MixerGigahertzCell.h"
#import "UIImageView+WebCache.h"

@interface SexItsPackView ()
@property (nonatomic, strong) UIImageView *squaresHeightImageView;
@end

@implementation SexItsPackView

- (void)littleTrustKeyRoundRecentOperandModel:(SettingsBeatInfo *)model {
[self indicatedHoldStayRussianSpeakingIndianGaelicModel:model];
    NSMutableArray *shift = [NSMutableArray new];
    for (int i = 0; i<model.aloneSplit; i++) {
        MixerGigahertzCell *cell = [[MixerGigahertzCell alloc]init];
        cell.eraSpecified = model.maskIndian;
        cell.channelCount = 1;
        cell.oneBin = 6;
        cell.moleUseSeekCar = CGFLOAT_MIN;
        CGRect plusRect = [model.rangingFinal boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:model.domainMartialIndexesHelperWaterHandball] forKey:NSFontAttributeName] context:nil];
        cell.busSaltSize = CGSizeMake(plusRect.size.width+8, plusRect.size.height+4);
        cell.model = model;
        [shift addObject:cell];
    }
    [self tamilBedArtPan:shift];
}

- (void)indicatedHoldStayRussianSpeakingIndianGaelicModel:(SettingsBeatInfo *)model {
    NSString *url = model.caffeineThatPrettyHallCarriagePayments;

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

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

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

- (void)paceDescenderImageView:(UIImageView *)way image:(UIImage *)image {
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    if (image.size.width > 0) {
        CGFloat moleCheck = image.size.height / image.size.width * width;
        
        CGFloat offsetY = (height - moleCheck) * 0.5;
        way.frame = CGRectMake(0, offsetY, width, moleCheck);
    } else {
        way.frame = self.bounds;
    }
}

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

@end
