He subestimado UITableView (como KRTableView) e implementado los cuatro métodos táctiles (touchesBegan, touchesEnded, touchesMoved y touchesCancelled) para poder detectar cuándo se está manejando un evento táctil en una UITableView . Esencialmente, lo que necesito detectar es cuando el UITableView se desplaza hacia arriba o hacia abajo.Detectando el desplazamiento de UITableView
Sin embargo, la subclase de UITableView y la creación de los métodos anteriores solo detecta cuándo se produce el desplazamiento o el movimiento de los dedos dentro de una UITableViewCell, no en todo el UITableView.
Tan pronto como mueva mi dedo a la siguiente celda, los eventos táctiles no harán nada.
Esta es la forma en que estoy de subclases UITableView:
#import "KRTableView.h"
@implementation KRTableView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
NSLog(@"touches began...");
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesMoved:touches withEvent:event];
NSLog(@"touchesMoved occured");
}
- (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent *)event {
[super touchesCancelled:touches withEvent:event];
NSLog(@"touchesCancelled occured");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesEnded:touches withEvent:event];
NSLog(@"A tap was detected on KRTableView");
}
@end
¿Cómo puedo detectar cuando el UITableView se desplaza hacia arriba o hacia abajo?
viewDidScroll es seguir siendo llamados, siempre y cuando se está desplazando. Entonces no puedes configurar tu variable isDragging en galse en scrollViewDidScroll. –
¿ES POSIBLE DISTINGUIR ENTRE SUBIR O BAJAR? – Markus
@Markus https://stackoverflow.com/questions/2543670/finding-the-direction-of-scrolling-in-a-uiscrollview – tdios