Skip to content

A cross platform Tab Bar that run and looks the same across iOS, iPadOS, macOS & tvOS. for SwiftUI

License

Notifications You must be signed in to change notification settings

Swiftodon/MultiplatformTabBar

 
 

Repository files navigation

MultiplatformTabBar

Creates a common Tab Bar control that runs and looks the same across multiple devices and OS (iOS, iPadOS, macOS & tvOS).

Installation

Swift Package Manager (Xcode 11 and above)

  1. Select File > Swift Packages > Add Package Dependency… from the File menu.
  2. Paste https://github.com/Appracatappra/MultiplatformTabBar.git in the dialog box.
  3. Follow the Xcode's instruction to complete the installation.

Why not CocoaPods, or Carthage, or blank?

Supporting multiple dependency managers makes maintaining a library exponentially more complicated and time consuming.

Since, the Swift Package Manager is integrated with Xcode 11 (and greater), it's the easiest choice to support going further.

Example

The following example would generate a Tab Bar with three Tabs in SwiftUI:

MultiplatformTabBar(tabPosition: .top, barHorizontalAlignment: .center)
.tab(title: "Categories", icon: Image(systemName: "tray.fill")) {
    VStack {
       ...
    }
}
.tab(title: "Products", icon: Image(systemName: "shippingbox.fill")) {
    VStack {
       ...
    }
}
.tab(title: "iCloud", icon: Image(systemName: "icloud.fill")) {
    VStack {
       ...
    }
}

Would produce an Tab bar like the following:

About

A cross platform Tab Bar that run and looks the same across iOS, iPadOS, macOS & tvOS. for SwiftUI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 94.8%
  • Shell 5.2%