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

Scrolling bug in the pagingViewController (IconsExample) when applying different width for selected cell in IconsExample #87

Closed
IVANKRUPSKI opened this issue Nov 27, 2017 · 9 comments

Comments

@IVANKRUPSKI
Copy link

Hey,

I have tried to set up different width for selected cell in IconsExample, wIth selected 60pt and not selected 80pt.

When I slide from controller to controller, relatively fast, pagingViewController on the top occasionally jumps from icon to icon without scrolling animation.

I have added

this

extension ViewController: PagingViewControllerDelegate {
    
    func pagingViewController<T>(_ pagingViewController: PagingViewController<T>, widthForPagingItem pagingItem: T, isSelected: Bool) -> CGFloat {
        
        if isSelected {
            return 80
        } else {
            return 40
        }
    }
    
}

and this

  override func viewDidLoad() {
    ...
    pagingViewController.delegate = self
  }

to the IconsExample ViewController. Did I miss anything? Was that correct?

@rechsteiner
Copy link
Owner

Yeah, that's correct. I get same bug here as well. Not sure what could be causing that, but I'll try to get that fixed pretty soon 👍

@rechsteiner
Copy link
Owner

I suspect this might have something to do with a bug I just fixed in #96, but I'm not 100% sure. At least I'm not able to reproduce the jumping after that fix. Could try out the latest master branch and see if you're still seeing this?

@IVANKRUPSKI
Copy link
Author

Unfortunately, bug is still there. I have 12 icons each 40 points in width, selected icon is 60 points in width.
I scroll the content controller one by one and selected paging menu item changes one by one, and when it reaches the middle, menu should scroll itself a bit, but it's slightly delayed and here is the flicker.

@IVANKRUPSKI
Copy link
Author

But you are right, there is no longer bug in your IconExample.
I will investigate why it is still there in our project.

@IVANKRUPSKI
Copy link
Author

Ok, I have noticed that it has definitely become better, however this flickering behavior is still there.
And the heavier the content controllers the buggier the behavior.

In your IconExample content controllers are empty, so you will hardly see any flicker.

In our case we have 12 collectionViews with hundreds of cells in each, so this does have an impact.
I reduced the number of cells to one per each collectionView and noticed that the bug almost disappeared.

@IVANKRUPSKI
Copy link
Author

And in order to see this bug one should scroll controllers rather fast one by one.

@rechsteiner
Copy link
Owner

Managed to figure out what was causing this; seems to be a performance issue with the way I was updating the content offset when the user is scrolling. Should be fixed it #106 ✌️

Let me know if this fixes your issue!

@IVANKRUPSKI
Copy link
Author

Yes, now it works smoothly. Thanks!

@rechsteiner
Copy link
Owner

Awesome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants