From cc9a67157d80ff527e3f8bd7d08f59dfcd293d70 Mon Sep 17 00:00:00 2001 From: Martin Barreto Date: Mon, 25 Jan 2016 16:21:32 -0300 Subject: [PATCH] minor fix --- Sources/PagerTabStripViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/PagerTabStripViewController.swift b/Sources/PagerTabStripViewController.swift index 3c8cca6..dd8a4d2 100644 --- a/Sources/PagerTabStripViewController.swift +++ b/Sources/PagerTabStripViewController.swift @@ -166,7 +166,7 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate //MARK: - Helpers public func updateIfNeeded() { - if !CGSizeEqualToSize(lastSize, containerView.bounds.size){ + if isViewLoaded() && !CGSizeEqualToSize(lastSize, containerView.bounds.size){ updateContent() } } @@ -311,8 +311,8 @@ public class PagerTabStripViewController: UIViewController, UIScrollViewDelegate isViewRotating = true pageBeforeRotate = currentIndex coordinator.animateAlongsideTransition(nil) { [weak self] _ in - self?.isViewRotating = false guard let me = self else { return } + me.isViewRotating = false me.currentIndex = me.pageBeforeRotate me.updateIfNeeded() }