From a80c0107341986032b70844152f04e8f25d87b44 Mon Sep 17 00:00:00 2001 From: Dave Wasden Date: Fri, 14 Apr 2017 11:18:17 -0600 Subject: [PATCH 1/4] Disable Cover Navbar initial --- Sources/TabPageOption.swift | 1 + Sources/TabPageViewController.swift | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/TabPageOption.swift b/Sources/TabPageOption.swift index 61663d2..7392f1f 100644 --- a/Sources/TabPageOption.swift +++ b/Sources/TabPageOption.swift @@ -23,6 +23,7 @@ public struct TabPageOption { public var pageBackgoundColor: UIColor = UIColor.white public var isTranslucent: Bool = true public var hidesTabBarOnSwipe: Bool = false + public var coverNavBar: Bool = false internal var tabBarAlpha: CGFloat { return isTranslucent ? 0.95 : 1.0 diff --git a/Sources/TabPageViewController.swift b/Sources/TabPageViewController.swift index 8d7ca25..3f22f4a 100644 --- a/Sources/TabPageViewController.swift +++ b/Sources/TabPageViewController.swift @@ -44,7 +44,7 @@ open class TabPageViewController: UIPageViewController { setupPageViewController() setupScrollView() - updateNavigationBar() + if option.coverNavBar { updateNavigationBar() } } override open func viewWillAppear(_ animated: Bool) { @@ -62,7 +62,7 @@ open class TabPageViewController: UIPageViewController { override open func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - updateNavigationBar() + if option.coverNavBar { updateNavigationBar() } tabView.layouted = true } From 968f4c501493dbdbee91153520f9017adff91020 Mon Sep 17 00:00:00 2001 From: Dave Wasden Date: Fri, 21 Apr 2017 10:36:45 -0600 Subject: [PATCH 2/4] Provided a refreshTabs method so you can refresh on events such as screen rotation/orientation change. --- Sources/TabPageViewController.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/TabPageViewController.swift b/Sources/TabPageViewController.swift index 3f22f4a..f5b4ec3 100644 --- a/Sources/TabPageViewController.swift +++ b/Sources/TabPageViewController.swift @@ -25,9 +25,8 @@ open class TabPageViewController: UIPageViewController { } fileprivate var beforeIndex: Int = 0 fileprivate var tabItemsCount = 0 - fileprivate var defaultContentOffsetX: CGFloat { - return self.view.bounds.width - } + fileprivate var defaultContentOffsetX: CGFloat = UIScreen.main.bounds.width + fileprivate var shouldScrollCurrentBar: Bool = true lazy fileprivate var tabView: TabView = self.configuredTabView() fileprivate var statusView: UIView? @@ -72,6 +71,11 @@ open class TabPageViewController: UIPageViewController { navigationController?.navigationBar.shadowImage = nil navigationController?.navigationBar.setBackgroundImage(nil, for: .default) } + + + public func refreshTabs() { + tabView = configuredTabView() + } } From b4002ddeceb36087a16eb48bda38d15b64cc3dd1 Mon Sep 17 00:00:00 2001 From: Dave Wasden Date: Fri, 21 Apr 2017 10:58:46 -0600 Subject: [PATCH 3/4] Keep tabBarAlpha flexible --- Sources/TabPageOption.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/TabPageOption.swift b/Sources/TabPageOption.swift index 7392f1f..a821420 100644 --- a/Sources/TabPageOption.swift +++ b/Sources/TabPageOption.swift @@ -24,10 +24,10 @@ public struct TabPageOption { public var isTranslucent: Bool = true public var hidesTabBarOnSwipe: Bool = false public var coverNavBar: Bool = false - - internal var tabBarAlpha: CGFloat { - return isTranslucent ? 0.95 : 1.0 - } + public var tabBarAlpha: CGFloat = 0.95 +// public var tabBarAlpha: CGFloat { +// return isTranslucent ? 0.95 : 1.0 +// } internal var tabBackgroundImage: UIImage { return convertImage() } From 1f9ea55e7e2a5b4223116a5a6fe891f9a8036c59 Mon Sep 17 00:00:00 2001 From: Dave Wasden Date: Fri, 21 Apr 2017 11:11:10 -0600 Subject: [PATCH 4/4] Version Change --- .../TabPageViewController_Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TabPageViewController.xcodeproj/TabPageViewController_Info.plist b/TabPageViewController.xcodeproj/TabPageViewController_Info.plist index 6159e9e..6bcdeda 100644 --- a/TabPageViewController.xcodeproj/TabPageViewController_Info.plist +++ b/TabPageViewController.xcodeproj/TabPageViewController_Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.2.6 + 0.2.7 CFBundleSignature ???? CFBundleVersion