Сбой UIPageViewController при быстрой прокрутке - PullRequest
0 голосов
/ 27 августа 2018

Я создал свой собственный UIPageViewController со следующим кодом:

- (void)setupPageViewController {  
self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll  
                                                          navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal  
                                                                        options:nil];  
    self.pageViewController.delegate = self;  
    self.pageViewController.dataSource = self;  
    [self addChildViewController:self.pageViewController];  
}  

тогда я вызываю следующий код:

if (targetPage > self.currentPage) {  
        [self.pageViewController setViewControllers:@[controller]  
                                          direction:UIPageViewControllerNavigationDirectionForward  
                                           animated:YES  
                                         completion:nil];  
} else {  
    [self.pageViewController setViewControllers:@[controller]  
                                          direction:UIPageViewControllerNavigationDirectionReverse  
                                           animated:YES  
                                         completion:nil];  
}  

Когда я вызываю этот код очень быстро, приложение вылетает и регистрирует следующее:

*** Assertion failure in -[UIPageViewController _flushViewController:animated:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3698.54.4/UIPageViewController.m:2137  

Я нашел какое-то решение об этой аварии:

Ошибка подтверждения в UIPageViewController

Ошибка подтверждения в UIPageViewController

на самом деле, который не может работать.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...