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

jump to specific index of page failed #100

Open
sharedcare opened this issue Jan 13, 2020 · 4 comments
Open

jump to specific index of page failed #100

sharedcare opened this issue Jan 13, 2020 · 4 comments

Comments

@sharedcare
Copy link

@sharedcare sharedcare commented Jan 13, 2020

I wrote following method in my code. However jump function does not work in this situation, it only jumps to the second page.

func swipeMenuView(_ swipeMenuView: SwipeMenuView, viewDidSetupAt currentIndex: Int) {
        swipeMenuView.jump(to: selectedPage, animated: true)
    }
@curiousurick
Copy link

@curiousurick curiousurick commented Jan 26, 2020

I'm having the same issue.

@JamesirYao
Copy link

@JamesirYao JamesirYao commented Jun 21, 2020

the same issue

@ericosg
Copy link

@ericosg ericosg commented Sep 9, 2020

Here's how I fixed it, hopefully helps you too:

Change public func jump:
in
SwipeMenuView.swift:

    public func jump(to index: Int, animated: Bool) {
         guard let tabView = tabView, let contentScrollView = contentScrollView else { return }
         if currentIndex != index {
             delegate?.swipeMenuView(self, willChangeIndexFrom: currentIndex, to: index)
+            isJumping = true // This was added to fix the jump() as it wasn't working
+        } else {
+            // This was added to fix the jump() as it wasn't working
+            isJumping = false
         }
         jumpingToIndex = index
         tabView.jump(to: index)
         contentScrollView.jump(to: index, animated: animated)
     }

@ericosg
Copy link

@ericosg ericosg commented Dec 8, 2020

Here's how I fixed it, hopefully helps you too:

Change public func jump:
in
SwipeMenuView.swift:

    public func jump(to index: Int, animated: Bool) {
         guard let tabView = tabView, let contentScrollView = contentScrollView else { return }
         if currentIndex != index {
             delegate?.swipeMenuView(self, willChangeIndexFrom: currentIndex, to: index)
+            isJumping = true // This was added to fix the jump() as it wasn't working
+        } else {
+            // This was added to fix the jump() as it wasn't working
+            isJumping = false
         }
         jumpingToIndex = index
         tabView.jump(to: index)
         contentScrollView.jump(to: index, animated: animated)
     }

This shouldn't be considered a fix, nor does it seem to be fixed otherwise, but as a solution it might help. It's causing more problems for me so I won't recommend the above.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.