Crash on pushviewcontroller to pagercontroller
anuraagdjain opened this issue · 2 comments
I'm having a viewcontroller with navigation controller. When I click a button I push to secondviewcontroller which uses PagerController,PagerDataSource
. The swiping of tabs works fine here. But when I click < Back
in the navigation bar, the app crashes.
topLayoutGuide += self.navigationController!.navigationBar.frame.size.height
, error is pointed at this location. Log showed up fatal error: unexpectedly found nil while unwrapping an Optional value
. frame value becomes zero.
Hey @anuraagdjain, sorry for the delay. I was able to find the bug and I think I solved the problem.
Can you please try to add this on that line?
if let nav = self.navigationController {
topLayoutGuide += nav.navigationBar.frame.size.height
}
Let me know if it works so I can fix that bug on the codesource 😄
It's perfect. No crashes now. :)