








#import "BigEndsInfoRow.h"

#define RedPanBitRate self.frame.size.width

@interface BigEndsInfoRow()



@property (nonatomic, strong) NSMutableArray                            *listCatArray;



@property (nonatomic, strong) NSMutableArray <FootBagNeedHerCell *>      *tallArray;



@property (strong, nonatomic) NSMutableArray <FootBagNeedHerCell *>      *chestPeakSix;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) CombiningSexualPotentialDisableIndexing                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   faxHow;

@end

@implementation BigEndsInfoRow

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.status = PrintableGigabitsForkHandlerHoverTropical;
    }
    return self;
}

- (void)hueIllEffort
{
    
    if (self.tallArray.firstObject) {
        
        
        FootBagNeedHerCell *insulinView = self.tallArray.firstObject;
        
        insulinView.frame = CGRectMake(RedPanBitRate, 0, insulinView.wayCurlSize.width, insulinView.wayCurlSize.height);
        
        self.faxHow = insulinView.faxHow;
        
        self.channelCount = insulinView.channelCount;
        
        
        NSInteger row = [self deprecateBestInvalidOffsetsDragExpandedHue:insulinView];
        
        
        if (row >= 0) {
            
            
            [self.tallArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:insulinView]) {
                [self addSubview:insulinView];
            }
            insulinView.frame = CGRectMake(RedPanBitRate,  row * (insulinView.wayCurlSize.height + _faxHow), insulinView.wayCurlSize.width, insulinView.wayCurlSize.height);
            
            
            [_listCatArray setObject:insulinView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(bevelLawListView:willDisplayCell:)]) {
                [self.delegate bevelLawListView:self willDisplayCell:insulinView];
            }
            
            
            [self.chestPeakSix addObject:insulinView];
            
            [insulinView packetOnlineJoinCountryInvite:^{
                
                
                [insulinView setTransform:CGAffineTransformMakeTranslation(- insulinView.frame.size.width-RedPanBitRate, 0)];
                
            } completion:^(BOOL finished) {
                
                [insulinView removeFromSuperview];
                
                
                [self.chestPeakSix removeObject:insulinView];
                
                
                if ([self.delegate respondsToSelector:@selector(bevelLawListView:didEndDisplayingCell:)]) {
                    [self.delegate bevelLawListView:self didEndDisplayingCell:insulinView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(letterItemDayFlowWhileFixExtendingSharpness:)]) {
                        [self.delegate letterItemDayFlowWhileFixExtendingSharpness:self];
                    }
                    self.count = 0;
                }
                
                

            }];
        }
    }
    
    [self performSelector:@selector(hueIllEffort) withObject:nil afterDelay:0.45f];
}


- (void)indexSkipStair:(NSArray <FootBagNeedHerCell *> *)barrages
{
    self.count += barrages.count;
    [self.tallArray addObjectsFromArray:barrages];
}

- (void)start
{
    if (self.status == NotifiesCatalystBackDenyFitMount) {
        return;
    }
    self.status = NotifiesCatalystBackDenyFitMount;
    
    [self hueIllEffort];
}

- (void)stop
{
    if (self.status == PrintableGigabitsForkHandlerHoverTropical) {
        return;
    }
    self.status = PrintableGigabitsForkHandlerHoverTropical;
    
    if (self.chestPeakSix.count) {
        [self.chestPeakSix makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.tallArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.chestPeakSix  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.chestPeakSix  removeAllObjects];
    [self.tallArray     removeAllObjects];
    [self.listCatArray  removeAllObjects];
    
    self.chestPeakSix       = nil;
    self.tallArray          = nil;
    self.listCatArray       = nil;
}


- (NSInteger)deprecateBestInvalidOffsetsDragExpandedHue:(FootBagNeedHerCell *)newBarrage
{
    for (int row = 0; row<_listCatArray.count; row++) {
        NSObject *object = _listCatArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[FootBagNeedHerCell class]]) { 
            
            FootBagNeedHerCell *fillerBook = (FootBagNeedHerCell*)object;
            
            if ([self deprecateBestInvalidOffsetsDragExpandedHue:fillerBook earlyMute:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)deprecateBestInvalidOffsetsDragExpandedHue:(FootBagNeedHerCell *)fillerBook earlyMute:(FootBagNeedHerCell *)newBarrage
{
    
    if (fillerBook.status == CapturedAreDomainMinimumHueAdjusts) {
        return NO;
    }
    
    
    CGRect rect = [fillerBook.layer.presentationLayer frame];
    if (rect.origin.x>RedPanBitRate - fillerBook.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (fillerBook.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = RedPanBitRate/(RedPanBitRate+newBarrage.frame.size.width)*newBarrage.faceLacrosse;
        
        CGFloat film = rect.origin.x - time/(fillerBook.faceLacrosse)*(RedPanBitRate + fillerBook.frame.size.width);
        if (film < -fillerBook.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *axial = [touches anyObject];
    CGPoint clearedHit  = [axial locationInView:self];
    for (UIView *taskAny in [self subviews])
    {
        if (![taskAny isKindOfClass:[FootBagNeedHerCell class]]) continue;
        FootBagNeedHerCell *insulinView = (FootBagNeedHerCell *)taskAny;
        if ([insulinView.layer.presentationLayer hitTest:clearedHit])
        {
            
            if ([self.delegate respondsToSelector:@selector(bevelLawListView:dailySparseCell:)]) {
                [self.delegate bevelLawListView:self dailySparseCell:insulinView];
            }
            break;
        }
    }
}




- (NSMutableArray<FootBagNeedHerCell *> *)tallArray {
    if (!_tallArray) {
        _tallArray = [[NSMutableArray alloc] init];
    }
    return _tallArray;
}


- (NSMutableArray<FootBagNeedHerCell *> *)chestPeakSix {
    if (!_chestPeakSix) {
        _chestPeakSix = [[NSMutableArray alloc] init];
    }
    return _chestPeakSix;
}


- (void)setChannelCount:(NSInteger)channelCount
{
    
    if (self.listCatArray.count < channelCount) { 
        
        for (NSInteger row = self.listCatArray.count; row < channelCount; row++) {
            NSNumber *number = [NSNumber numberWithBool:YES];
            [self.listCatArray setObject:number atIndexedSubscript:row];
        }
        
    }else {
        
        for (NSInteger row = channelCount; row < self.listCatArray.count; row++) {
            [self.listCatArray removeObjectAtIndex:row];
        }
    }
    
    _channelCount = channelCount;
    
}


- (NSMutableArray *)listCatArray {
    if (!_listCatArray) {
        _listCatArray = [[NSMutableArray alloc] init];
    }
    return _listCatArray;
}

@end
