yysskk / SwipeMenuViewController

Swipable tab and menu View and ViewController.
MIT License
1.29k stars 131 forks source link

Jump to the selected page #61

Open chaoshenglu opened 6 years ago

chaoshenglu commented 6 years ago

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) } jumpingToIndex = index tabView.jump(to: index) contentScrollView.jump(to: index, animated: animated) self.setNeedsLayout() // should add }

yysskk commented 6 years ago

What is the reason for doing it?

hilajqinnovation commented 5 years ago

How can I Jump to second tab without taping the second one. I tried this method, jump(to index: Int, animated: Bool) but always its showing the first one as selected. Help me please..