Skip to content

Commit

Permalink
Fix readPages bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tamanyan committed Oct 3, 2017
1 parent 672db6e commit f49a8f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/PageMenuController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ open class PageMenuController: UIViewController {

if let beforeIndex = self.beforeIndex {
self.tabView.pageTabItems = titles
self.tabView.updateCurrentIndex(beforeIndex, shouldScroll: true, animated: false)
self.tabView.updateCurrentIndex(beforeIndex, shouldScroll: false, animated: false)
}

guard defaultIndex < self.viewControllers.count else {
Expand Down
7 changes: 5 additions & 2 deletions Sources/TabMenu/TabMenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,11 @@ extension TabMenuView {

// hidden visible decorations
self.hiddenVisibleDecorations()
// scoll to center of current cell
self.collectionView.scrollToItem(at: currentIndexPath, at: .centeredHorizontally, animated: false)

if let _ = self.collectionView.cellForItem(at: currentIndexPath) {
// scoll to center of current cell
self.collectionView.scrollToItem(at: currentIndexPath, at: .centeredHorizontally, animated: false)
}
}
}

Expand Down

0 comments on commit f49a8f1

Please sign in to comment.