{"id":13462651,"url":"https://github.com/emrepun/StickyTabBarViewController","last_synced_at":"2025-03-25T05:32:08.773Z","repository":{"id":37419338,"uuid":"249372361","full_name":"emrepun/StickyTabBarViewController","owner":"emrepun","description":"Sticky and Collapsible View on top of tab bar","archived":false,"fork":false,"pushed_at":"2023-05-13T12:49:12.000Z","size":151,"stargazers_count":151,"open_issues_count":0,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T07:44:43.324Z","etag":null,"topics":["bottom-sheet","bottomsheet","collapsible","swift","tabbarcontroller","ui-components"],"latest_commit_sha":null,"homepage":"","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/emrepun.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-03-23T08:16:39.000Z","updated_at":"2025-01-12T03:01:32.000Z","dependencies_parsed_at":"2022-08-19T12:40:23.526Z","dependency_job_id":null,"html_url":"https://github.com/emrepun/StickyTabBarViewController","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrepun%2FStickyTabBarViewController","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrepun%2FStickyTabBarViewController/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrepun%2FStickyTabBarViewController/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrepun%2FStickyTabBarViewController/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emrepun","download_url":"https://codeload.github.com/emrepun/StickyTabBarViewController/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407464,"owners_count":20610226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bottom-sheet","bottomsheet","collapsible","swift","tabbarcontroller","ui-components"],"created_at":"2024-07-31T13:00:18.147Z","updated_at":"2025-03-25T05:32:08.437Z","avatar_url":"https://github.com/emrepun.png","language":"Swift","readme":"# StickyTabBarViewController\nSticky and Collapsible View Controller on top of tab bar\n\n![](https://media.giphy.com/media/W519AMUoGGIDx8eHBE/giphy.gif)\n![](https://media.giphy.com/media/eNvbHbouudojLUu1dZ/giphy.gif)\n\n## Requirements:\n- iOS 10.0\n- Tab bar is visible as long as there is a sticky view controller allocated on top of it (any vc pushed at any point should not set ```hidesBottomBarWhenPushed``` to ```true```.\n\n## Installation\n\nStickyTabBarViewController is available through [SPM](https://swift.org/package-manager/) and [CocoaPods](http://cocoapods.org).\n\n- SPM Installation:\nAdd it as a new package dependency with https://github.com/emrepun/StickyTabBarViewController.git\n\n- CocoaPods Installation:\n\nSimply add the following line to your Podfile:\n\n```ruby\npod 'StickyTabBarViewController', '1.0.5'\n```\n\n## Usage\n\nSubclass ```StickyViewControllerSupportingTabBarController``` from your tab bar controller.\n\nConfigure animation duration or collapsed view height directly from your tabbar controller:\n\nFrom ```viewDidLoad```:\n\n```swift\nimport UIKit\nimport StickyTabBarViewController\n\nclass MainTabBarController: StickyViewControllerSupportingTabBarController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        collapsedHeight = 50.0\n        animationDuration = 0.5\n    }\n}\n\n```\n\nBy overriding initialisers of the tabbar controller:\n\n```swift\noverride init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {\n    super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)\n    // here if you are using xib\n    collapsedHeight = 50.0\n    animationDuration = 0.5\n}\n\nrequired init?(coder: NSCoder) {\n    super.init(coder: coder)\n    // configure also on required init (if you are using storyboard for example)\n    collapsedHeight = 50.0\n    animationDuration = 0.5\n}\n```\n\nCan also update it any time by accessing to tabBarController.\n\n## Presented View Controller Configurations:\n\nAny view controller to have sticky behaviour must conform to ```Expandable``` and implement a ```minimisedView```.\n\nThe implemented ```minimisedView``` should be ideally anchored on top of the view controller's view and its height (either by a direct height constraint or some other constraints) should be equal to the value of ```collapsedHeight```. You don't need to worry about hiding or showing it since it is handled by StickyTabBarViewController itself.\n\n```swift\nvar minimisedView: UIView {\n    return UIView() // or return your outlet for minimised view.\n}\n```\n\nCollapse sticky view from the view controller that conforms to ```Expandable``` as following:\n\n```swift\ncontainer?.collapseChild()\n```\n\nExpand sticky view from the view controller that conforms to ```Expandable``` as following:\n\n```swift\ncontainer?.expandChild()\n```\n\nRemove sticky view from the view controller that conforms to ```Expandable``` as following:\n\n```swift\ncontainer?.removeCollapsableChild(animated:)\n```\n\nConfigure a Sticky child ViewController as following:\n\n```swift\nif let tabBarController = tabBarController as? StickyViewControllerSupportingTabBarController {\n    let viewControllerToStick = SampleChildViewController()\n    tabBarController.configureCollapsableChild(viewControllerToStick,\n                                               isFullScreenOnFirstAppearance: true)\n}\n```\n\n## Interaction with the presented sticky child view controller from anywhere with tabBarController access:\n\nAccess tabBarController to interact with sticky child view controller:\n\n```swift\nvar tabController: StickyViewControllerSupportingTabBarController? {\n    if let tabBarController = tabBarController as? StickyViewControllerSupportingTabBarController {\n        return tabBarController\n    }\n    return nil\n}\n```\n\nExpand/collapse child view controller:\n\n```swift\ntabController?.collapseChild()\n```\n\n```swift\ntabController?.expandChild()\n```\n\n## Pending Improvements:\n- It would be nice to have the ability to hide tab bar and status bar upon expanding, in parameterised way.\n- Right now it is not possible to configure or overwrite the implemented sticky VC, one must first remove it and then implement another if needed. Maybe implement overwriting if configure is called while there is already a view controller allocated?\n","funding_links":[],"categories":["Animation"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrepun%2FStickyTabBarViewController","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrepun%2FStickyTabBarViewController","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrepun%2FStickyTabBarViewController/lists"}