Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Crash on pushviewcontroller to pagercontroller #15

Closed
anuraagdjain opened this issue Jul 25, 2016 · 2 comments
Closed

Crash on pushviewcontroller to pagercontroller #15

anuraagdjain opened this issue Jul 25, 2016 · 2 comments
Labels

Comments

@anuraagdjain
Copy link

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.

@lfarah lfarah added the bug label Jul 25, 2016
@lfarah
Copy link
Collaborator

lfarah commented Aug 2, 2016

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 😄

@anuraagdjain
Copy link
Author

It's perfect. No crashes now. :)

@lfarah lfarah closed this as completed Aug 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants