I'm trying to play a sound on touchesEnded but I'm having a problem. There are multiple objects that get moved around, so if the below code holds true when any object is moved, it constantly plays the sound. How do I only play it once?
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
if(CGRectContainsRect([image1 frame], [image2 frame])){
[self playsound];
}
}