Swiftpack.co - twodayslate/SplitTabBar as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by twodayslate.
twodayslate/SplitTabBar v1.0.4
UISplitViewController and UITabBarController in sync
⭐️ 4
🕓 3 weeks ago
.package(url: "https://github.com/twodayslate/SplitTabBar.git", from: "v1.0.4")

SplitTabBar

A UISplitViewController combined with a UITabBarController in sync

macOS ScreenshotiPad Screenshot

Usage

import SplitTabBar

let splitTabBar = SplitTabBarViewController(viewControllers: [/*view controllers here*/])

The navigatable view controllers are controlled via the tab bar detail view controller. You can modify them like so:

splitTabBar.setViewControllers([/*your new view controllers */])
// or
splitTabBar.detailTabBar.viewControllers = [/*your new view controllers */]

If you want the UITabBarController tabs to always be present you can enable them via

splitTabBar.shouldHideTabBar = false

You can see an example of showing both the UISplitViewController navigation and the UITabBarController tabs in the macOS screenshots above.

By default the SplitTabBarViewController will hide the UISplitViewController and just display the UITabBarController when its traitCollection horizontalSizeClass is compact. You can change this behavior using the following properties:

splitTabBar.compactPreferredDisplayMode = UISplitViewController.DisplayMode.primaryHidden
splitTabBar.regularPreferredDisplayMode = UISplitViewController.DisplayMode.automatic

GitHub

link
Stars: 4
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Version 1.0.4
2 years ago
  • Bug fixes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics