Cómo verificar un ID de un objeto que se ha tocado (iOS)

En mi Vista tengo una matriz con un montón de puntos diferentes, luego la paso a través de un bucle para crear un montón de cuadrados diferentes en la vista. También puede ver que intenté usar el identificador de accesibilidad para crear una ID como sistema. Probablemente sea una mala práctica, pero me quedé sin ideas jaja. Aquí está la vista:

#import "LevelOneView.h"


@implementation LevelOneView
@synthesize squareLocations;




- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}


- (void)drawRect:(CGRect)rect
{

    squareLocations = [[NSMutableArray alloc] init];

    CGPoint dotOne = CGPointMake(1, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotOne]];

    CGPoint dotTwo = CGPointMake(23, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotTwo]];

    CGPoint dotThree = CGPointMake(45, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotThree]];

    CGPoint dotFour = CGPointMake(67, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotFour]];

    CGPoint dotFive = CGPointMake(89, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotFive]];

    CGPoint dotSix = CGPointMake(111, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotSix]];

    CGPoint dotSeven = CGPointMake(133, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotSeven]];

    CGPoint dotEight = CGPointMake(155, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotEight]];

    CGPoint dotNine = CGPointMake(177, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotNine]];

    CGPoint dotTen = CGPointMake(199, 25);
    [squareLocations addObject:[NSValue valueWithCGPoint:dotTen]];

    int numby = [squareLocations count];

    for (int i = 0; i < numby; i++)
    {
        NSValue *pointLocation = [squareLocations objectAtIndex:i];
        CGPoint tmpPoint = [pointLocation CGPointValue];

        UIImage *theSquare = [UIImage imageNamed:@"square.png"];

        NSString *myID = [NSString stringWithFormat:@"%d", i];
        [theSquare setAccessibilityLabel:myID];
        [theSquare drawInRect:CGRectMake(tmpPoint.x, tmpPoint.y, theSquare.size.width, theSquare.size.height)];

    }

}


@end

Por lo tanto, mi objetivo es poder decir en qué cuadrado se ha deslizado una vez que se ha deslizado. Así que estoy buscando una identificación como sistema, que pueda revisar el deslizamiento actual sobre la "identificación" del objeto y decidir qué hacer con él desde allí. Intenté escribir algo así en el controlador de la vista:

#import "LevelOneController.h"

@interface LevelOneController ()

@end

@implementation LevelOneController
@synthesize whereStuffActuallyHappens;

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSLog(@"View loaded");
}


- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *touch = [[event allTouches] anyObject];
    CGPoint touchLocation = [touch locationInView:self.view];

    for (UIView *view in self.view.subviews)
    {

        if ([touch.accessibilityLabel isEqual: @"1"] && CGRectContainsPoint(view.frame, touchLocation))
        {

            [view removeFromSuperview];
        }

    }

}




- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end

Una vez más, puedes verme intentando usar la etiqueta de accesibilidad en este caso ... jaja. ¿Alguien tiene alguna idea de cómo lograr esto? ¿Hay alguna manera de que pueda dar una identificación a cada casilla individual y luego verificar la identificación de esa casilla cuando se desliza? ¡Gracias!

Respuestas a la pregunta(2)

Su respuesta a la pregunta