I am comparing two files in my script. using the command 

```
comm -3 123.txt 321.txt" 

```

These two files 123 and 321 has only numeric content.

Also I use 

```
diff -ibw abc.txt cba.txt

```

These files abc and cba has alphanumeric content

If there is no mismatch no output is printed can you help me how to write a condition as below.

If there is no difference I need to print `files match` 
If there is a difference I want to print `mismatch found` along with the mismatched output.
['https://Stackoverflow.com/questions/48884451', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9054895/']
```
- (void)collectionView:(UICollectionView *)collectionView
   willDisplayCell:(UICollectionViewCell *)cell
forItemAtIndexPath:(NSIndexPath *)indexPath{

CGFloat collectionHeight = self.CollectionView.bounds.size.height;
CGFloat contentOffsetY = self.CollectionView.contentOffset.y;
CGFloat contentSizeHeight = self.CollectionView.contentSize.height;
CGFloat height = 0.0;

if(isCollectionViewScrollUp && contentOffsetY + self.CollectionView.frame.size.height < contentSizeHeight) {

    int index = (int)indexPath.row + 1;

    if (index % 3 == 1){
        height = collectionHeight + 300;
    }else if(index % 3 == 2){
        height = collectionHeight + 300 * 2;

    }else{
        height = collectionHeight + 300 * 3;
    }
    cell.transform = CGAffineTransformMakeTranslation(0, height);

}else if(!isCollectionViewScrollUp && contentOffsetY > 0.0){

    int index = (int)indexPath.row + 1;

    if(index % 3 == 1){
        height = collectionHeight  + 300 * 3;
    }else if(index % 3 == 2){
        height = collectionHeight + 300 * 2;
    }else{
        height = collectionHeight + 300;
    }

    cell.transform = CGAffineTransformMakeTranslation(0, -height);
}

[UIView animateWithDuration:1 delay:0.03 usingSpringWithDamping:0.8 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseIn animations:^{

    cell.transform = CGAffineTransformMakeTranslation(0, 0);

} completion:nil]; 
}  

-(void) scrollViewDidScroll:(UIScrollView *)scrollView {
CGPoint scrollVelocity = [CollectionView.panGestureRecognizer velocityInView:CollectionView.superview];
if (scrollVelocity.y > 0.0) { //ScrollDown
    isCollectionViewScrollUp = NO;
} else if (scrollVelocity.y < 0.0 ){ //ScrollUp
    isCollectionViewScrollUp = YES;
}
}

```
Try This:

```
var isCollectionViewScrollUp: Bool = true

func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
    let collectionHeight: CGFloat = self.collectionView!.bounds.size.height

    let contentOffsetY: CGFloat = self.collectionView.contentOffset.y
    let contentSizeHeight: CGFloat = self.collectionView.contentSize.height

    var height:CGFloat = 0.0//collectionHeight * CGFloat(indexPath.row)

    if isCollectionViewScrollUp && (contentOffsetY + self.collectionView.frame.size.height) < contentSizeHeight {

        let index = Int(indexPath.row) + Int(1)
        if index % 3 == 1 {
            height = collectionHeight + 300
        }
        else if index % 3 == 2 {
            height = collectionHeight + 300 * 2
        }
        else {
            height = collectionHeight + 300 * 3
        }

        cell.transform = CGAffineTransform(translationX: 0, y: height)
    } else if !isCollectionViewScrollUp && contentOffsetY > 0.0 {
        let index = Int(indexPath.row) + Int(1)
        if index % 3 == 1 {
            height = collectionHeight + 300 * 3
        }
        else if index % 3 == 2 {
            height = collectionHeight + 300 * 2
        }
        else {
            height = collectionHeight + 300
        }

        cell.transform = CGAffineTransform(translationX: 0, y: -height)
    }

    UIView.animate(withDuration: 1, delay: 0.03, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: {
        cell.transform = CGAffineTransform(translationX: 0, y: 0);
    }, completion: nil)

}

func scrollViewDidScroll(_ scrollView: UIScrollView) {
    let scrollVelocity:CGPoint  = self.collectionView.panGestureRecognizer.velocity(in: self.collectionView?.superview)
    if scrollVelocity.y > 0.0 { //ScrollDown
        isCollectionViewScrollUp = false
    } else if scrollVelocity.y < 0.0 { //ScrollUp
        isCollectionViewScrollUp = true
    }
}

```