He creado una subclase personalizada de UIView porque necesitaba anular el método drawRect. Intento agregarle un UITAPGestureRecognizer, pero esto no me funciona. En este caso, el código de mi ViewController:UITapGestureRecognizer no se inicia en UIView Subclase
MyCustomView *customView = [[MyCustomView alloc] initWithFrame:CGRectFrame(0, 30, 30, 30)];
[customView setUserInteractionEnabled:YES];
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doSomething)];
[customView addGestureRecognizer:tapGestureRecognizer];
No entiendo por qué cuando me toco el objeto UIView subclase, el reconocedor gesto no se dispara hacia arriba.
¡Muchas gracias de antemano!
FIXED IT OUT!
Mi vista estaba en un UIImageView, y ese UIImageView no tenía el userInteractionEnabled
establecido en SÍ.
es tus límites/marco correcto? – CarlJ
Aparentemente sí, mi subclase es, de hecho, un círculo dibujado con CoreGraphics. el marco es: 10, 30, 30, 30. – Vinestro
Para más información (puede ayudar), el código que le muestro se encuentra en el método tableView: cellForRowAtIndexPath. Una idea ? – Vinestro