SwipeMenuViewController icon indicating copy to clipboard operation
SwipeMenuViewController copied to clipboard

ReloadData calls viewControllerForPageAt twice

Open pcentieiro opened this issue 5 years ago • 7 comments

Describe the bug If a SwipeMenuView is added to a ViewController (following a reloadData), or reloadData is called on the Demo project (using SwipeMenuViewController) the viewControllerForPageAt is called twice.

To Reproduce Steps to reproduce the behavior:

  1. Setup a SwipeMenuView
  2. Call reloadData
  3. Add a breakpoint/log on viewControllerForPageAt and you'll see being called twice per entry

Expected behavior A clear and concise description of what you expected to happen.

iPhone (please complete the following information):

  • Device: iPhone 8
  • OS: 12.1
  • Version: 3.0.0

pcentieiro avatar Apr 04 '19 21:04 pcentieiro

Same Issue

dks333 avatar Nov 10 '19 08:11 dks333

same issue. I want to add Load more feature. What is the alternative of self.swipeMenuView.reloadData() to reload TableView without reloading Tiltes and everything?

JhonnyTawk avatar Nov 25 '19 10:11 JhonnyTawk

I had same issue, and could fix it. In my case, I was using SwipeMenuViewOptions. I init SwipeMenuView without options, create options, and did self.swipeMenuView.reloadData(options: options), so everything was called twice. I init SwipeMenuView with options at the first time, then all problem was solved.

hope it would help.

hiromiick avatar Dec 04 '19 07:12 hiromiick

Same issue guys,

@hiromiick I tried to resolve with what you suggested but still getting 2 calls

AjayOdedara avatar Oct 05 '20 23:10 AjayOdedara

Same issue for me, any solution please ?

Arshad-iOSDeveloper avatar Sep 27 '23 07:09 Arshad-iOSDeveloper

I had same issue, and could fix it. In my case, I was using SwipeMenuViewOptions. I init SwipeMenuView without options, create options, and did self.swipeMenuView.reloadData(options: options), so everything was called twice. I init SwipeMenuView with options at the first time, then all problem was solved.

hope it would help.

Its always better to paste the code

Arshad-iOSDeveloper avatar Sep 27 '23 07:09 Arshad-iOSDeveloper

The problem is not with the options, it is related to reload() method. Even i am not able to solve the problem. So thinking to remove this library and use horizontal collection view for tabs

Arshad-iOSDeveloper avatar Sep 29 '23 07:09 Arshad-iOSDeveloper