How do I make it to where 2 UIImageViews touch a UIAlertView pops up ?
Hi ! I am trying to make it where a falling object with this animation code:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationRepeatCount:0];
myBalloon.center = moveRight.center;
[UIView commitAnimations];
This code makes the UIImageView go from one image to another. I have it where another code moves from left to right. I did this code to try and make it where if the 2 ImageViews touch an alertview would pop up but it doesn't work. Here is the code.
if (CGRectIntersectsRect(myNail.frame, myBalloon.frame)) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"hit!" message:@"yeah man!" delegate:self cancelButtonTitle:@"dismiss" otherButtonTitles:nil];
[alert show];
[alert release];
}
Its just not working and I tried it on a different project like when it doesn't move just one view from another and it just doesn't wanna work. Can anyone help ? Please and thank you.
|