Giter VIP home page Giter VIP logo

pep's Introduction

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.

pep's People

Contributors

befy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.