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

Crash when menuItemViews.count == 1 #48

Closed
kayvink opened this issue Jul 27, 2015 · 4 comments
Closed

Crash when menuItemViews.count == 1 #48

kayvink opened this issue Jul 27, 2015 · 4 comments

Comments

@kayvink
Copy link
Contributor

kayvink commented Jul 27, 2015

My app crashes if I run the PagingMenuController with only one viewController

I have tracked the bug down to contentOffsetXForCurrentPage in MenuView.

menuItemViews.count is 1
nextIndex is 0
menuItemViews.count - 1 is 0
let ratio = nextIndex / menuItemViews.count - 1 is 0 / 0 which returns nan

Here is the error log:
2015-07-27 13:36:34.350 Authenticator[94857:984290] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan 0; 375 60]'

@kitasuke
Copy link
Owner

Thanks for the error report.

PagingMenuController does not support with only one view controller, not documented yet though.
How use case is it with only one view controller?

@kayvink
Copy link
Contributor Author

kayvink commented Jul 27, 2015

The app displays updates on different accounts, you can add and remove accounts so the amount can vary.

@kayvink
Copy link
Contributor Author

kayvink commented Jul 27, 2015

I fixed it, pushing a pull request in a sec.

@kitasuke
Copy link
Owner

Thanks! I'll look into it :)

@kitasuke kitasuke mentioned this issue Jul 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants