In my View I have an array with a bunch of different points, then I run that array through a loop to create a bunch of different squares in the view. You can also see that I tri
Rakesh is definitely right with his comments, use UIImageView
if you can.
Also touchesMoved
will not detect your squares because you haven't added them as subviews, they are only images drawn in your view, which is another reason you should rather use uiimageviews.
If you are insisting on doing it this (much harder) way: I suggest you to keep an NSDictionary with your ids as keys and cgrect frames of your squares as objects. And then with every touch iterate through all possible keys and call CGRectContainsPoint
on your objects. Return the affiliated id (key) when point is contained within the rect. But I don't recommend doing so.