Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pagingEnabled not working. #23

Closed
wants to merge 2 commits into from
Closed

Fix pagingEnabled not working. #23

wants to merge 2 commits into from

Conversation

chickdan
Copy link
Contributor

@chickdan chickdan commented May 12, 2017

If collectionViewPaginatedScroll was true it set collectionView.isPagingEnabled to false and it was never set to true anywhere. So setting paginationEnabled inside of GLTableCollectionViewController did nothing.

@giulio92
Copy link
Owner

Hello @chickdan,

Could you explain better the purpose of this PR? I think that the current code follows the behavior I thought in the beginning, do you see any problems with this?

Thank you

@giulio92 giulio92 self-assigned this May 13, 2017
@chickdan
Copy link
Contributor Author

chickdan commented May 13, 2017

Sure, so first when I was playing with the demo I didn't notice a change in behavior when I changed the boolean paginationEnabled (as per the directions in the Readme). So I took a look in GLCollectionTableViewCell and noticed that you had:

if collectionViewPaginatedScroll == true {
   collectionView.isPagingEnabled = false 
}

Which is the opposite of the desired behavior, if the boolean is true you want it to paginate.

Second, because there is no else statement isPagingEnabled is never set to the opposite value. So in the context of your current code, isPagingEnabled is false by default when the collectionView is created and therefore never set to true because of the above if statement.

So with this PR I simply switched the false to true and added an else so that the value can be switched.

Edit: I was pretty tired when I made the change and after thinking about it, there shouldn't even be a conditional. It should be collectionView.isPagingEnabled = collectionViewPaginatedScroll

@giulio92
Copy link
Owner

Hello @chickdan,

Thank you really much for the explanation 😊, I will try your changes and see how the new behavior works 😊

Thank you really much for your help!

@stale
Copy link

stale bot commented Nov 6, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the closed label Nov 6, 2017
@giulio92 giulio92 added standby and removed closed labels Nov 6, 2017
@stale stale bot removed the standby label Nov 6, 2017
@stale stale bot closed this Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants