








#import "SelfDigestClip.h"

#define SettingRepeat self.frame.size.width

@interface SelfDigestClip()



@property (nonatomic, strong) NSMutableArray                            *pressedArray;



@property (nonatomic, strong) NSMutableArray <FourCharPanAndCell *>      *drumArray;



@property (strong, nonatomic) NSMutableArray <FourCharPanAndCell *>      *hoverOwnJump;



@property (assign, nonatomic) NSInteger                                 count;



@property (nonatomic, assign) GrandauntPetabytesDecayAtomRequiring                          status;



@property (nonatomic, assign) NSInteger                                 channelCount;



@property (nonatomic, assign) CGFloat                                   winEgg;

@end

@implementation SelfDigestClip

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

- (void)prepDayBevel
{
    
    if (self.drumArray.firstObject) {
        
        
        FourCharPanAndCell *bankLowView = self.drumArray.firstObject;
        
        bankLowView.frame = CGRectMake(SettingRepeat, 0, bankLowView.reorderSize.width, bankLowView.reorderSize.height);
        
        self.winEgg = bankLowView.winEgg;
        
        self.channelCount = bankLowView.channelCount;
        
        
        NSInteger row = [self coachedRenamingMissingArtistIntegralPeriodicFolder:bankLowView];
        
        
        if (row >= 0) {
            
            
            [self.drumArray removeObjectAtIndex:0];
            
            
            if (![self.subviews containsObject:bankLowView]) {
                [self addSubview:bankLowView];
            }
            bankLowView.frame = CGRectMake(SettingRepeat,  row * (bankLowView.reorderSize.height + _winEgg), bankLowView.reorderSize.width, bankLowView.reorderSize.height);
            
            
            [_pressedArray setObject:bankLowView atIndexedSubscript:row];
            
            
            if ([self.delegate respondsToSelector:@selector(disparityJobView:willDisplayCell:)]) {
                [self.delegate disparityJobView:self willDisplayCell:bankLowView];
            }
            
            
            [self.hoverOwnJump addObject:bankLowView];
            
            [bankLowView insertingCoercionPermuteSchoolManagers:^{
                
                
                [bankLowView setTransform:CGAffineTransformMakeTranslation(- bankLowView.frame.size.width-SettingRepeat, 0)];
                
            } completion:^(BOOL finished) {
                
                [bankLowView removeFromSuperview];
                
                
                [self.hoverOwnJump removeObject:bankLowView];
                
                
                if ([self.delegate respondsToSelector:@selector(disparityJobView:didEndDisplayingCell:)]) {
                    [self.delegate disparityJobView:self didEndDisplayingCell:bankLowView];
                }
                
                
                if (--self.count <= 0) {
                    if ([self.delegate respondsToSelector:@selector(cursiveTorqueVortexInuitFocalNotationTelephonySignature:)]) {
                        [self.delegate cursiveTorqueVortexInuitFocalNotationTelephonySignature:self];
                    }
                    self.count = 0;
                }
                
                

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


- (void)nowFaxOptHertz:(NSArray <FourCharPanAndCell *> *)barrages
{
    self.count += barrages.count;
    [self.drumArray addObjectsFromArray:barrages];
}

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

- (void)stop
{
    if (self.status == ProteinTiedSemanticRefinedEffortResponses) {
        return;
    }
    self.status = ProteinTiedSemanticRefinedEffortResponses;
    
    if (self.hoverOwnJump.count) {
        [self.hoverOwnJump makeObjectsPerformSelector:@selector(pause)];
    }
    
    if (self.drumArray.count > 0) {
        [NSObject cancelPreviousPerformRequestsWithTarget:self];
    }
    
    
    [self.hoverOwnJump  makeObjectsPerformSelector:@selector(removeFromSuperview)];
    self.channelCount       = 0;
    self.count              = 0;
    [self.hoverOwnJump  removeAllObjects];
    [self.drumArray     removeAllObjects];
    [self.pressedArray  removeAllObjects];
    
    self.hoverOwnJump       = nil;
    self.drumArray          = nil;
    self.pressedArray       = nil;
}


- (NSInteger)coachedRenamingMissingArtistIntegralPeriodicFolder:(FourCharPanAndCell *)newBarrage
{
    for (int row = 0; row<_pressedArray.count; row++) {
        NSObject *object = _pressedArray[row];
        if ([object isKindOfClass:[NSNumber class]]) { 
            
            return row;
            
        }else if ([object isKindOfClass:[FourCharPanAndCell class]]) { 
            
            FourCharPanAndCell *mapMinCurl = (FourCharPanAndCell*)object;
            
            if ([self coachedRenamingMissingArtistIntegralPeriodicFolder:mapMinCurl eastAllow:newBarrage]) {
                
                return row;
            }
        }
    }
    
    return -1;
}


- (BOOL)coachedRenamingMissingArtistIntegralPeriodicFolder:(FourCharPanAndCell *)mapMinCurl eastAllow:(FourCharPanAndCell *)newBarrage
{
    
    if (mapMinCurl.status == OceanSunNetFoodDrizzleValidity) {
        return NO;
    }
    
    
    CGRect rect = [mapMinCurl.layer.presentationLayer frame];
    if (rect.origin.x>SettingRepeat - mapMinCurl.frame.size.width) {
        
        return NO;
    }else if (rect.size.width == 0)
    {
        
        return NO;
    }
    else if (mapMinCurl.frame.size.width > newBarrage.frame.size.width) {
        
        return YES;
    }else
    {
        
        CGFloat time = SettingRepeat/(SettingRepeat+newBarrage.frame.size.width)*newBarrage.sumWaxAuthor;
        
        CGFloat gasp = rect.origin.x - time/(mapMinCurl.sumWaxAuthor)*(SettingRepeat + mapMinCurl.frame.size.width);
        if (gasp < -mapMinCurl.frame.size.width) {
            
            return YES;
        }
    }
    return NO;
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *bound = [touches anyObject];
    CGPoint romanPulse  = [bound locationInView:self];
    for (FourCharPanAndCell *bankLowView in [self subviews])
    {
        if ([bankLowView.layer.presentationLayer hitTest:romanPulse])
        {
            
            if ([self.delegate respondsToSelector:@selector(disparityJobView:sawInputAnyCell:)]) {
                [self.delegate disparityJobView:self sawInputAnyCell:bankLowView];
            }
            break;
        }
    }
}




- (NSMutableArray<FourCharPanAndCell *> *)drumArray {
    if (!_drumArray) {
        _drumArray = [[NSMutableArray alloc] init];
    }
    return _drumArray;
}


- (NSMutableArray<FourCharPanAndCell *> *)hoverOwnJump {
    if (!_hoverOwnJump) {
        _hoverOwnJump = [[NSMutableArray alloc] init];
    }
    return _hoverOwnJump;
}


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


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

@end
