ios objective-c uiscrollview uiscrollviewdelegate

ios - UIScrollViewDelegate scrollViewWillEndDragging: withVelocity: targetContentOffset recibiendo call con pagingEnabled=YES



objective-c (0)

Según la documentación de Apple (y muchos otros lugares), UIScrollViewDelegate: scrollViewWillEndDragging: withVelocity: targetContentOffset no se llama si UIScrollView.pagingEnabled se establece en YES. En iOS6 esto parece ser cierto, sin embargo, en iOS7 SIEMPRE me llaman, sin importar en qué pagingEnabled esté configurado.

Aquí hay un controlador simple de vista de prueba:

@interface ViewController () <UIScrollViewDelegate> @property (weak, nonatomic) IBOutlet UIWebView *webView; @end @implementation ViewController - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset { NSLog(@"%d", scrollView.pagingEnabled); } - (void)viewDidLoad { [super viewDidLoad]; [self loadHTML]; [self configureWebView]; } - (void)loadHTML { NSString* htmlPath = [[NSBundle mainBundle] pathForResource:@"htmlContent" ofType:@"html"]; NSString* htmlString = [NSString stringWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:nil]; [_webView loadHTMLString:htmlString baseURL:nil]; } - (void)configureWebView { [_webView.scrollView setDelegate:self]; _webView.scrollView.pagingEnabled = YES; } @end

En iOS7, si pagingEnabled == YES, el NSLog en scrollViewWillEndDragging imprime 1, si está establecido en NO, imprime 0.

En iOS6, cuando pagingEnabled == YES, la salida de la consola es:

Stop offset can not be modified for paging scroll views

Cuando es NO, la salida es 0.

¿Alguien más está obteniendo esto? ¿Alguien sabe si se supone que esto es así en iOS7? La documentación no ha cambiado, así que supongo que no, pero pensé en preguntarles a todos antes de presentar un informe de error con Apple y agregar cheques para paginación habilitados en todas mis llamadas de delegado.