Im using this code to try to detect collisions between two images, one of which is in an animation, but it doesn't work.
[UIView animateWithDuration:5 animations:^{
bird.center = CGPointMake(bird.center.x, 600);
fallTimer = [NSTimer scheduledTimerWithTimeInterval:.001 target:self selector:@selector(check) userInfo:nil repeats:YES];
}];
-(void)check {
if (CGRectIntersectsRect(bird.frame, cat.frame)) {
NSLog(@"YES");
}
}
How can i detect the collision?