From 2824f07a1bf4b87dc283bbad4cd6da4d088466aa Mon Sep 17 00:00:00 2001 From: Tibor Kertesz Date: Thu, 27 Apr 2017 14:55:48 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20for:=20Onboard=20with=20just=20one=20page?= =?UTF-8?q?=20and=20swipingEnabled=20=3D=20YES=20combination=20caused=20Ex?= =?UTF-8?q?ception=20and=20crashed=20the=20app=20when=20swiping.=20The=20f?= =?UTF-8?q?ix:=20Added=20=E2=80=9Cself.viewControllers.count=20>=201?= =?UTF-8?q?=E2=80=9D=20condition=20to=20the=20beginning=20of=20the=20trans?= =?UTF-8?q?itioningFromLastPage=20boolean=20evaulation.=20The=20error=20wa?= =?UTF-8?q?s=20indexing=20out=20of=20the=20=E2=80=9Cself.viewControllers?= =?UTF-8?q?=E2=80=9D=20array=E2=80=99s=20range.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/OnboardingViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OnboardingViewController.m b/Source/OnboardingViewController.m index 1c50a98..0bee86f 100644 --- a/Source/OnboardingViewController.m +++ b/Source/OnboardingViewController.m @@ -348,7 +348,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { // determine if we're transitioning to or from our last page BOOL transitioningToLastPage = (_currentPage != self.viewControllers.lastObject && _upcomingPage == self.viewControllers.lastObject); - BOOL transitioningFromLastPage = (_currentPage == self.viewControllers.lastObject) && (_upcomingPage == self.viewControllers[self.viewControllers.count - 2]); + BOOL transitioningFromLastPage = (self.viewControllers.count > 1) && (_currentPage == self.viewControllers.lastObject) && (_upcomingPage == self.viewControllers[self.viewControllers.count - 2]); // fade the page control to and from the last page if (self.fadePageControlOnLastPage) {