1
I’m using TabBarController
and I get this mistake :
The number of view controllers provided (2) doesn’t match the number required (1) for the requested Transition
When I exit the home screen and return to it from this error. I find it strange because the first time I access the home screen I do not get any error is only when I leave it and I return there yes I get this error. I’ve tried to be too isdoublesided
for true
But the screen hangs when I rotate it. I will post the code :
let currentViewController : PageContentViewController = self.pageViewController!.viewControllers![0] as! PageContentViewController
var viewControllers: [UIViewController]
let indexOfCurrentViewController = self.indexOfViewController(currentViewController)
if (indexOfCurrentViewController == 0) || (indexOfCurrentViewController % 2 == 0) {
let nextViewController = self.pageViewController(self.pageViewController!, viewControllerAfter: currentViewController)
viewControllers = [currentViewController, nextViewController!]
} else {
let previousViewController = self.pageViewController(self.pageViewController!, viewControllerBefore: currentViewController)
viewControllers = [previousViewController!, currentViewController]
}
self.pageViewController!.setViewControllers(viewControllers, direction: .forward, animated: true, completion: {done in })
return .mid
Always falling in the if
and error is giving in the penultimate line before return .mid
.
Any help thanks! Thanks!