### Manual Installation Source: https://github.com/eggswift/estabbarcontroller/blob/master/README.md Manually add the ESTabBarController library to your project by cloning the repository and opening the project. ```ruby git clone https://github.com/eggswift/ESTabBarController.git open ESTabBarController ``` -------------------------------- ### Install via Carthage Source: https://github.com/eggswift/estabbarcontroller/blob/master/README.md Use Carthage to manage the ESTabBarController dependency by adding the GitHub repository to your Cartfile. ```ruby github "eggswift/ESTabBarController" ``` -------------------------------- ### Custom Tab Bar Controller Setup Source: https://github.com/eggswift/estabbarcontroller/wiki/Home Subclass ESTabBarController to manage your view controllers and assign custom tab bar items. This example sets up five view controllers with custom tab bar items using the TabBarContentView. ```swift class MyCustomTabBar: ESTabBarController{ override func viewDidLoad() { super.viewDidLoad() let v1 = self.storyboard?.instantiateViewController(withIdentifier: "Home1") as! Home1 let v2 = self.storyboard?.instantiateViewController(withIdentifier: "Screen2") as! Screen2 let v3 = self.storyboard?.instantiateViewController(withIdentifier: "Screen3") as! Screen3 let v4 = self.storyboard?.instantiateViewController(withIdentifier: "Screen4") as! Screen4 let v5 = self.storyboard?.instantiateViewController(withIdentifier: "Screen5") as! Screen5 v1.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Home", image: UIImage(named: "home"), selectedImage: UIImage(named: "home2")) v2.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen2", image: UIImage(named: "Screen2"), selectedImage: UIImage(named: "Screen2")) v3.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen3", image: UIImage(named: "Screen3"), selectedImage: UIImage(named: "Screen3")) v4.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen4", image: UIImage(named: "Screen4"), selectedImage: UIImage(named: "Screen4")) v5.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Screen5", image: UIImage(named: "Screen5"), selectedImage: UIImage(named: "Screen5")) self.viewControllers = [v1,v2,v3,v4,v5] self.delegate = self } } ``` -------------------------------- ### Install via Swift Package Manager Source: https://github.com/eggswift/estabbarcontroller/blob/master/README.md Add the ESTabBarController library to your project using Swift Package Manager by specifying the repository URL and version. ```swift dependencies: [ .package(name: "ESTabBarController", url: "https://github.com/eggswift/ESTabBarController.git", from: "2.9.0-spm") ] ``` -------------------------------- ### Install via CocoaPods Source: https://github.com/eggswift/estabbarcontroller/blob/master/README.md Integrate ESTabBarController into your project using CocoaPods by adding the specified pod name to your Podfile. ```ruby pod "ESTabBarController-swift" ``` -------------------------------- ### Custom Tab Bar Item View Source: https://github.com/eggswift/estabbarcontroller/wiki/Home Subclass ESTabBarItemContentView to define the visual appearance and animations for your tab bar items. This example implements a bounce animation on selection. ```swift class TabBarContentView: ESTabBarItemContentView { public var duration = 0.3 override init(frame: CGRect) { super.init(frame: frame) //define the text label and icon color for normal and highlighted mode. textColor = UIColor(red:0.38, green:0.49, blue:0.55, alpha:1.0) //Or whatever color you want highlightTextColor = UIColor.red ////Or whatever color you want iconColor = UIColor(red:0.38, green:0.49, blue:0.55, alpha:1.0) //Or whatever color you want highlightIconColor = UIColor.red ////Or whatever color you want } public required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func selectAnimation(animated: Bool, completion: (() -> ())?) { self.bounceAnimation() completion?() } override func reselectAnimation(animated: Bool, completion: (() -> ())?) { self.bounceAnimation() completion?() } func bounceAnimation() { let impliesAnimation = CAKeyframeAnimation(keyPath: "transform.scale") impliesAnimation.values = [1.0 ,1.4, 0.9, 1.15, 0.95, 1.02, 1.0] impliesAnimation.duration = duration * 2 impliesAnimation.calculationMode = kCAAnimationCubic imageView.layer.add(impliesAnimation, forKey: nil) } } ``` -------------------------------- ### Instantiate and Configure View Controller with ESTabBarItem Source: https://github.com/eggswift/estabbarcontroller/wiki/Home This snippet shows how to instantiate a view controller, assign a custom tab bar item with a title and images, and use a custom ESTabBarItemContentView. ```swift let v1 = self.storyboard?.instantiateViewController(withIdentifier: "HomeVC") as! HomeVC v1.tabBarItem = ESTabBarItem.init(TabBarContentView(), title: "Home", image: UIImage(named: "home"), selectedImage: UIImage(named: "home2")) ``` -------------------------------- ### Assign View Controllers to ESTabBarController Source: https://github.com/eggswift/estabbarcontroller/wiki/Home This snippet demonstrates how to set the array of view controllers for the ESTabBarController and assign the delegate. ```swift self.viewControllers = [v1,v2,v3,v4,v5] self.delegate = self ``` -------------------------------- ### Custom Tab Bar Controller Delegate Implementation Source: https://github.com/eggswift/estabbarcontroller/wiki/Home Implement the UITabBarControllerDelegate protocol for your custom ESTabBarController subclass to handle tab bar controller delegate methods, such as animation controllers for view controller transitions. ```swift extension MyCustomTabBar : UITabBarControllerDelegate{ func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { //....your delegate code } //other delegate methods as required.... } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.