Pep is a lightweight, highly customizable TabBar-like approach.
Pep is an approach outside of the standard "Tab Bar" stance. Lightweight, customizable and improvable.
- iOS 11.0+
- Xcode 10.0+
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
- Download and drop
Sources
file in your project. - Congratulations!
- Create a class that inherits from
PepTabBarController
import Pep
final class TabBarController: PepTabBarController {}
- In this class, initialize view controllers that you want to present in bar.
let homeViewController = HomeViewController()
let favoritesViewController = FavoritesViewController()
let settingsViewController = SettingsViewController()
- 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)
- In
viewDidLoad
assign these view controllers toself.viewControllers
override func viewDidLoad() {
super.viewDidLoad()
self.viewControllers = [
homeViewController, favoritesViewController, settingsViewController
]
}
- Voila! You are ready to go. See example project for further customization.
We would love you for the contribution to Pep.
befy – @alpertab – [email protected]
Pep is available under the MIT license. See the LICENSE file for more info.