Skip to content
/ Pep Public

🏹 Pep is a lightweight, highly customizable TabBar-like approach.

License

Notifications You must be signed in to change notification settings

befy/Pep

Repository files navigation

Pep a.k.a PepBar

Pep is a lightweight, highly customizable TabBar-like approach.

Swift Version License: MIT CocoaPods Compatible
Platform PRs Welcome

Pep is an approach outside of the standard "Tab Bar" stance. Lightweight, customizable and improvable.

Requirements

  • iOS 11.0+
  • Xcode 10.0+

Installation

CocoaPods

You can use CocoaPods to install Pep by adding it to your Podfile:

pod 'Pep'

Then, run the following command in command-line:

$ pod install

To get the full benefits import Pep wherever you import UIKit

import UIKit
import Pep

Manually

  1. Download and drop Sources file in your project.
  2. Congratulations!

Usage example

  1. Create a class that inherits from PepTabBarController
import Pep
final class TabBarController: PepTabBarController {}
  1. In this class, initialize view controllers that you want to present in bar.
let homeViewController = HomeViewController()
let favoritesViewController = FavoritesViewController()
let settingsViewController = SettingsViewController()
  1. Assign UITabBarItem to view controllers with title, image and selected image properties.
let image = UIImage(named: "x").withRenderingMode(.alwaysOriginal)
let selectedImage = UIImage(named: "y").withRenderingMode(.alwaysOriginal)
homeViewController.tabBarItem = UITabBarItem(title: title, image: image, selectedImage: selectedImage)
  1. In viewDidLoad assign these view controllers to self.viewControllers
override func viewDidLoad() {
    super.viewDidLoad()

    self.viewControllers = [
        homeViewController, favoritesViewController, settingsViewController
    ]
}
  1. Voila! You are ready to go. See example project for further customization.

Contribute

We would love you for the contribution to Pep.

Meta

befy – @alpertab[email protected]

Pep is available under the MIT license. See the LICENSE file for more info.

About

🏹 Pep is a lightweight, highly customizable TabBar-like approach.

Resources

License

Stars

Watchers

Forks

Packages

No packages published