Swiftpack.co - Package - LenisDev/TabBar

Minimal, yet higly customizable

License MIT CI Tests Carthage compatibility pod Plateform compatibility


Overview

Leight-weight, reusable and heighly customizable tab bar.

  • Simple icons

TabBar_highlight

  • Selected with Border style

TabBar_highlight

  • Selected with Circle style

TabBar_highlight

  • Text with capsule style

TabBar_highlight

  • Text and Icon

TabBar_highlight

  • Text and Icon with capsule style

TabBar_highlight

Checkout Example Project

Usage

  
  // Step 1: Create Data for tab bar   
  let tabItems = [TabBarItemViewModel(id: UUID().description, title: "Tab 1", image: UIImage(systemName: "trash"), state: .selected),
                  TabBarItemViewModel(id: UUID().description, title: "Tab 2", image: nil)]
                  
  // Step 2: Create tab bar
  let tabView = TabBarView(data: TabBarViewModel(items: tabItems)) { [weak self] (selectedItem) in // always use weak to avoid reference cycle
    // on item selected
    print(selectedItem)
  }
  
  // Step 3: Customize (optional)  
  tabView
    // apply style on tabView (tab items are placed inside this view)
    .style(RectStyle())
    // apply styles on tab item
    .itemUnselectedStyle(RectStyle())
    .itemSelectedStyle(CapsuleBorderStyle())
  

Installation Guide

Carthage

Step 1: Add following to your CartFile

github "LenisDev/TabBar" ~> 0.0.2

Step 2: run carthage update from current project directory.

That's all, you have it installed.


CocoaPods

Step 1: Add pod 'Tab', '~> 0.0.2' to your Podfile:

target 'MyApp' do
  pod 'Tab', '~> 0.0.2'
end

Step 2: run pod install from current project directory.

That's all, you have it installed.


Try it using following command

pod try Tab

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/LenisDev/TabBar.git", .upToNextMajor(from: "0.0.2"))
]

Contribute

  • Play around and report bugs
  • Fix issues and create PR
  • Add documentations and new features

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

Added docs and SPM - 2020-08-25 04:41:57

Release date: 25-Aug-2020

New Features

  • [X] Added more examples
  • [X] Added SPM support
  • [X] Added SwiftLint
  • [X] Added docs
  • [X] Added useful links to README

Bug Fixes:

  • [X] Fixed style issues

Initial release - 2020-08-24 09:42:41

Release date: 24-Aug-2020

New Features:

  • [X] Tab bar with custom items
  • [X] Custom styles for selected and unselected states
  • [X] Custom item presentation
  • [X] UI and data helper extensions
  • [X] CocoaPod support