Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 2.55 KB

README.md

File metadata and controls

84 lines (63 loc) · 2.55 KB

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.