i am developing a card game which requires uiimageviews. i have a view based application. i have added 5imageviews in it.
each imageview has a unique card. nw the user can drag a card on top of any other card present. for this i need to know which card has been selected. how to do this?
touches enabled works in all places in my view. i want touches to be enabled only on uiimageview.
how can i activate touches to the imageviews alone present in my viewcontroller.
thanks in advance..
What you can do is in touchesBegan: method you can check which location in your view is selected using
CGPoint point = [recognizer locationInView:self];
And then do a for loop to check which imageview is selected like this
for(i = 0; i < 5; i++)
{
if(CGRectContainsPoint(imageView.frame, point))
{
// do something.
}
}