{"id":32313918,"url":"https://github.com/brkyvrkn/tab-kit","last_synced_at":"2026-07-04T15:32:14.235Z","repository":{"id":56903362,"uuid":"284053447","full_name":"brkyvrkn/tab-kit","owner":"brkyvrkn","description":"CocoaPods library to capsulate one-or-more view controllers inside of the containers","archived":false,"fork":false,"pushed_at":"2020-08-05T00:14:24.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T10:34:42.242Z","etag":null,"topics":["cocoapods","ios","swift","tabbarcontroller","viewcontroller"],"latest_commit_sha":null,"homepage":"https://brkyvrkn.github.io/BTabViewController","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brkyvrkn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-31T14:18:31.000Z","updated_at":"2021-12-18T13:17:30.000Z","dependencies_parsed_at":"2022-08-20T18:50:57.597Z","dependency_job_id":null,"html_url":"https://github.com/brkyvrkn/tab-kit","commit_stats":null,"previous_names":["brkyvrkn/btabviewcontroller"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/brkyvrkn/tab-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkyvrkn%2Ftab-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkyvrkn%2Ftab-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkyvrkn%2Ftab-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkyvrkn%2Ftab-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brkyvrkn","download_url":"https://codeload.github.com/brkyvrkn/tab-kit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brkyvrkn%2Ftab-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35127443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","ios","swift","tabbarcontroller","viewcontroller"],"created_at":"2025-10-23T10:14:52.015Z","updated_at":"2026-07-04T15:32:14.230Z","avatar_url":"https://github.com/brkyvrkn.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BTabViewController\n\n[![CI Status](https://img.shields.io/travis/brkyvrkn/BTabViewController.svg?style=flat)](https://travis-ci.org/brkyvrkn/BTabViewController)\n[![Version](https://img.shields.io/cocoapods/v/BTabViewController.svg?style=flat)](https://cocoapods.org/pods/BTabViewController)\n[![License](https://img.shields.io/cocoapods/l/BTabViewController.svg?style=flat)](https://cocoapods.org/pods/BTabViewController)\n[![Platform](https://img.shields.io/cocoapods/p/BTabViewController.svg?style=flat)](https://cocoapods.org/pods/BTabViewController)\n[![Swift Version](https://img.shields.io/badge/Swift-4%20\u0026%205-41ab5d.svg)](https://developer.apple.com/swift)\n[![Objective-C compatible](https://img.shields.io/badge/Objective--C-compatible-f0a030.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n## Installation\n\nBTabViewController is available through [CocoaPods](https://cocoapods.org/pods/BTabViewController) but fist; make sure that you are working on the workspace not the project, otherwise you need to first initialize the workspace. Simply go to the project directory in terminal and run  `pod init`, then cocoa will handle for initializing and creating the workspace. Next, open _Podfile_ and add the following script to the file below the line _Pods for \u003cPROJECT_NAME\u003e_\n\n```ruby\npod 'BTabViewController'\n```\n\nNow open again the terminal and run following command\n\n```bash\npod install\n```\n\nWe are ready to design the views!\n\n## Requirements\n\nBTabViewController does not need any dependent 3rd party, so just _XCode 10+_ version is enough to use.\n\n\n## Usage\n\nJust look at first the models which we will oftenly use\n\n### Models\n\n```swift\n/// To define child view controllers and their id\npublic struct BTabModel {\n    // Attributes\n    public var id: String\n    public var target: UIViewController\n}\n```\nIt uses for accessing directly to the class of view which we have already appended into `var tabList: [BTabModel]` while creating the containers. For instance, `tabList[0].target` will give the ViewController class of the container view at 0th order.\n\n```swift\n/// Order should begin with zero\npublic struct BTabItemModel: Equatable {\n    // Attributes\n    public var order: Int\n    public var title: String\n    public var titleFont: UIFont = .systemFont(ofSize: 12)\n    public var titleTextColor: UIColor = .init(red: 64/255.0, green: 64/255.0, blue: 64/255.0, alpha: 1.0)\n    public var highlightFont: UIFont = .systemFont(ofSize: 12, weight: .bold)\n    public var highlightTextColor: UIColor = .init(red: 64/255.0, green: 64/255.0, blue: 64/255.0, alpha: 1.0)\n    public var backgroundColor: UIColor = .clear\n    public var textAlignment: NSTextAlignment = .left\n    // Private protection level attributes\n    private var isActive: Bool = false\n}\n```\n\nModel to determine the cells at the top which belongs to `var tabCollectionView`. The models which I explained above should set in the `setView(tabList: [BTabModel], tabItems: [BTabItemModel])` function. And important to call `super.setView(tabList: lists, tabItems: tabs)` after adjustment has done.\n\n### Parameters\n\n```swift\n// Sizing\nopen var tabsGap: CGFloat = 8\nopen var tabInset: CGFloat = 12\nopen var tabWidth: CGFloat = 80\nopen var tabsHeight: CGFloat = 50\nopen var tabAlignment: NSTextAlignment = .left\n// Flags\nopen var fitTabs: Bool = false\nopen var indicatorIsRounded: Bool = true\nopen var isIndicatorVisible: Bool = true\nopen var isIndicatorSlide: Bool = false\nopen var isAnimated: Bool = true\n// Indicator\nopen var indicatorView: UIView?\nopen var indicatorHeight: CGFloat = 4\nopen var indicatorWidth: CGFloat = 20\nopen var indicatorColor: UIColor = .init(red: 64/255.0, green: 64/255.0, blue: 64/255.0, alpha: 1.0)\n```\n\nThese are the parameters of `BTabViewController` and their default values. You can adjust the parameters depending on your desire in \n\n```swift\noverride func setView(tabList: [BTabModel], tabItems: [BTabItemModel]) {\n    self.tabsGap = 0\n    self.tabInset = 0\n    self.tabsHeight = 30\n    self.fitTabs = true\n    self.isIndicatorVisible = false\n\n    super.setView(tabList: tabList, tabItems: tabItems)\n}\n```\n\n### Delegation\n\nYou just inherit the `BTabViewController` in the ViewController which will be used to base controller class.\n\n```swift\nclass FirstContainerViewController: BTabViewController {\n\n}\n```\n\nNow override the delegate functions to communicate with the base class about the triggering event such as scroll, selecting _(tapping)_ the tab.\n\n```swift\npublic protocol BTabViewControllerProtocol: class {\n    /// Trigger just tapping on the tab no matter the previous state\n    /// - Parameters:\n    ///   - target: Which container class did triggerred\n    ///   - item: Selected tab item model\n    ///   - index: Selected index order\n    func listTab(_ target: UIViewController, didSelect item: BTabItemModel, index: Int)\n    /// Called just changing operation did\n    /// - Parameters:\n    ///   - target: Container class just activated\n    ///   - to: Newly changed tab model\n    func listTab(_ target: UIViewController, tabSwitched toItem: BTabItemModel)\n}\n```\n\nFirst function will be triggerred when every tapping action on the tab. The second one will just catch changing view action.\n\n### Integrate UI\n\n\u003eIf you clone the repository and open with XCode, you will see the example project and related schemas. I collected the storyboards as Main and Tabs which they have corresponding `.xibs`.\n\nCreate a ViewController in storyboard and connect it to its class. Next, add container view inside it. This shows how the base controller should be in storyboard.\n\n![Integrate_UI_fig1](https://i.ibb.co/Lx4q45q/Screen-Shot-2020-08-05-at-02-41-48.png\")\n\nThen we are able to implement protocol function and adjust the design parameters in the class.\n\n```swift\nimport UIKit\nimport BTabViewController\n\nclass FirstContainerViewController: BTabViewController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n    }\n\n    // MARK: - BTab Stuff\n    override func setView(tabList: [BTabModel], tabItems: [BTabItemModel]) {\n        // Model setting\n        let firstTabVC = ExampleStoryboards.instantiateViewController(in: .tabs, classOf: FirstTabViewController.self)!\n        let secondTabVC = ExampleStoryboards.instantiateViewController(in: .tabs, classOf: SecondTabViewController.self)!\n        let thirdTabVC = ExampleStoryboards.instantiateViewController(in: .tabs, classOf: ThirdTabViewController.self)!\n        let firstList = BTabModel(id: \"1\", target: firstTabVC)\n        let secondList = BTabModel(id: \"2\", target: secondTabVC)\n        let thirdList = BTabModel(id: \"3\", target: thirdTabVC)\n        let lists = [firstList, secondList, thirdList]\n\n        var firstTab = BTabItemModel(order: 0, title: \"First\")\n        firstTab.highlightFont = .systemFont(ofSize: 16, weight: .bold)\n        firstTab.textAlignment = .center\n        var secondTab = BTabItemModel(order: 1, title: \"Second\")\n        secondTab.highlightFont = .systemFont(ofSize: 16, weight: .bold)\n        secondTab.textAlignment = .center\n        var thirdTab = BTabItemModel(order: 2, title: \"Third\")\n        thirdTab.highlightFont = .systemFont(ofSize: 16, weight: .bold)\n        thirdTab.textAlignment = .center\n        let tabs: [BTabItemModel] = [firstTab, secondTab, thirdTab]\n\n        // Parameter adjusting\n        self.tabsGap = 0\n        self.tabInset = 0\n        self.tabsHeight = 30\n        self.fitTabs = true\n        self.isIndicatorVisible = false\n\n        // Dont forget to call super\n        super.setView(tabList: lists, tabItems: tabs)\n    }\n\n    override func listTab(_ target: UIViewController, didSelect item: BTabItemModel, index: Int) {\n        super.listTab(target, didSelect: item, index: index)\n    }\n\n    override func listTab(_ target: UIViewController, tabSwitched toItem: BTabItemModel) {\n        super.listTab(target, tabSwitched: toItem)\n    }\n}\n```\n\nRun the example project on any device, the transitions and their visualizations are illustrated below `gif`. You can simply observe the flow when size of views are changed. The customization is very adaptive too.\n\n![Alt Text](https://media.giphy.com/media/WqcTRVHMddZqGqwdiQ/giphy.gif)\n\n## Author\n\nBerkay Vurkan, berkayvurkan@yahoo.com\n\n## License\n\nBTabViewController is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrkyvrkn%2Ftab-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrkyvrkn%2Ftab-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrkyvrkn%2Ftab-kit/lists"}