From 0b18389a26685205727ae540063caf90ae10dec3 Mon Sep 17 00:00:00 2001 From: David Doty Date: Mon, 29 Jul 2019 15:31:01 -0400 Subject: [PATCH] Adding support to reload ButtonBarView. This allows for update of the child view controller page indicator dynamically. --- Sources/ButtonBarPagerTabStripViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/ButtonBarPagerTabStripViewController.swift b/Sources/ButtonBarPagerTabStripViewController.swift index 36e008d6..ce4d22e9 100644 --- a/Sources/ButtonBarPagerTabStripViewController.swift +++ b/Sources/ButtonBarPagerTabStripViewController.swift @@ -194,9 +194,13 @@ open class ButtonBarPagerTabStripViewController: PagerTabStripViewController, Pa open override func reloadPagerTabStripView() { super.reloadPagerTabStripView() guard isViewLoaded else { return } + reloadButtonBarView() + buttonBarView.moveTo(index: currentIndex, animated: false, swipeDirection: .none, pagerScroll: .yes) + } + + open func reloadButtonBarView() { buttonBarView.reloadData() cachedCellWidths = calculateWidths() - buttonBarView.moveTo(index: currentIndex, animated: false, swipeDirection: .none, pagerScroll: .yes) } open func calculateStretchedCellWidths(_ minimumCellWidths: [CGFloat], suggestedStretchedCellWidth: CGFloat, previousNumberOfLargeCells: Int) -> CGFloat {