diff --git a/Example/Example/Base.lproj/Storyboard.storyboard b/Example/Example/Base.lproj/Storyboard.storyboard index cef0e71..82c8926 100644 --- a/Example/Example/Base.lproj/Storyboard.storyboard +++ b/Example/Example/Base.lproj/Storyboard.storyboard @@ -94,9 +94,20 @@ + + @@ -107,6 +118,7 @@ + diff --git a/Example/Example/ReloadExampleViewController.swift b/Example/Example/ReloadExampleViewController.swift index f295041..8db1b88 100644 --- a/Example/Example/ReloadExampleViewController.swift +++ b/Example/Example/ReloadExampleViewController.swift @@ -65,6 +65,11 @@ class ReloadExampleViewController: UIViewController { } } + + @IBAction func closeTapped(sender: UIButton) { + dismissViewControllerAnimated(true, completion: nil) + } + func updateTitle(pagerTabStripViewController: PagerTabStripViewController) { func stringFromBool(bool: Bool) -> String { return bool ? "YES" : "NO" diff --git a/README.md b/README.md index d4032d0..d8c829a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ License: MIT

-Made with ❤️ by [Xmartlabs](http://xmartlabs.com). +Made with ❤️ by [Xmartlabs](http://xmartlabs.com). Android [PagerTabStrip](http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html) for iOS! @@ -201,7 +201,7 @@ We may need to update the indicator cell when the displayed view controller chan public var changeCurrentIndex: ((oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, animated: Bool) -> Void)? public var changeCurrentIndexProgressive: ((oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void)? -Let's see am example: +Let's see an example: ```swift changeCurrentIndexProgressive = { (oldCell: ButtonBarViewCell?, newCell: ButtonBarViewCell?, progressPercentage: CGFloat, changeCurrentIndex: Bool, animated: Bool) -> Void in diff --git a/Sources/TwitterPagerTabStripViewController.swift b/Sources/TwitterPagerTabStripViewController.swift index fbfeaea..cc9b27b 100644 --- a/Sources/TwitterPagerTabStripViewController.swift +++ b/Sources/TwitterPagerTabStripViewController.swift @@ -43,14 +43,14 @@ public class TwitterPagerTabStripViewController: PagerTabStripViewController, Pa public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) - pagerBehaviour = .Common(skipIntermediateViewControllers: true) + pagerBehaviour = .Progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true) delegate = self datasource = self } required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - pagerBehaviour = PagerTabStripBehaviour.Common(skipIntermediateViewControllers: true) + pagerBehaviour = .Progressive(skipIntermediateViewControllers: true, elasticIndicatorLimit: true) delegate = self datasource = self } @@ -73,7 +73,7 @@ public class TwitterPagerTabStripViewController: PagerTabStripViewController, Pa titleView.addSubview(pageControl) reloadNavigationViewItems() } - + public override func reloadPagerTabStripView() { super.reloadPagerTabStripView() guard isViewLoaded() else { return } @@ -123,7 +123,7 @@ public class TwitterPagerTabStripViewController: PagerTabStripViewController, Pa } deinit { - titleView.removeObserver(self, forKeyPath: "frame") + NSNotificationCenter.defaultCenter().removeObserver(self) } public override func viewDidLayoutSubviews() { @@ -133,7 +133,7 @@ public class TwitterPagerTabStripViewController: PagerTabStripViewController, Pa // MARK: - Helpers - private lazy var titleView: UIView = { [unowned self] in + private lazy var titleView: UIView = { let navigationView = UIView() navigationView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] return navigationView