I have two layers. The bottom layer consists of hidden UIImageViews, the upper layer consists of visible UIImageViews. They have labels in it. When all the frames of the bottom layer UIImageViews are equal to the frames of the upper layer UIImageViews and the labels are also matching, you have to see that in a NSLog. The problem is that when all the labels are not matching, I still get the NSLog. The method is called by a NSTimer
.
This is my code:
-(void)allPiecesCorrectPos {
__block BOOL equal = YES;
[arrayImg enumerateObjectsUsingBlock:^(UIImageView *ImageView1, NSUInteger idx, BOOL *stop) {
UIImageView *ImageView2 = HiddenFieldView[idx];
if (CGRectIntersectsRect(ImageView1.frame, ImageView2.frame) && ImageView1.tag != ImageView2.tag) {
equal = NO;
*stop = YES;
}
}];
if (equal) {
NSLog(@"ALL THE FRAMES ARE EQUAL");
[AllPosCorrectTimer invalidate];
}
}
How can I solve this?