{"id":2647,"url":"https://github.com/uptechteam/AirBar","last_synced_at":"2025-08-03T00:32:16.194Z","repository":{"id":56901668,"uuid":"83022715","full_name":"uptechteam/AirBar","owner":"uptechteam","description":"iOS library - UIScrollView driven expandable menu. ","archived":false,"fork":false,"pushed_at":"2019-11-16T10:39:12.000Z","size":5713,"stargazers_count":638,"open_issues_count":4,"forks_count":53,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-04-24T14:50:36.003Z","etag":null,"topics":["ios","swift","uiscrollview"],"latest_commit_sha":null,"homepage":"https://blog.uptech.team/how-to-implement-expandable-menu-on-ios-like-in-airbnb-3d2bdd97b049","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/uptechteam.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":"2017-02-24T09:05:16.000Z","updated_at":"2024-04-16T07:37:46.000Z","dependencies_parsed_at":"2022-08-20T18:50:40.451Z","dependency_job_id":null,"html_url":"https://github.com/uptechteam/AirBar","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2FAirBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2FAirBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2FAirBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptechteam%2FAirBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uptechteam","download_url":"https://codeload.github.com/uptechteam/AirBar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510745,"owners_count":17931759,"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":["ios","swift","uiscrollview"],"created_at":"2024-01-05T20:16:19.175Z","updated_at":"2024-12-06T18:30:37.877Z","avatar_url":"https://github.com/uptechteam.png","language":"Swift","funding_links":[],"categories":["UI","Swift","Content"],"sub_categories":["Menu","Other free courses"],"readme":"\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/uptechteam/AirBar/\"\u003e\u003cimg src=\"Logo/Logo.png\" alt=\"AirBar\" width=\"600\" height=\"120\" /\u003e\u003c/a\u003e\u003cbr /\u003e\u003cbr /\u003e\n  UIScrollView driven expandable menu. \u003cbr /\u003e\u003cbr /\u003e\n  \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n## Description\n\nAirBar is a library for creating cool expandable menus.\nLibrary observes UIScrollView scroll and provides state you can apply to your UI elements.\n\n## Demo\n![AirBar Demo](/Logo/Demo.gif)\n\n## Installation\nLibrary supports [Carthage](https://github.com/Carthage/Carthage) dependency manager. To install AirBar add following line to Cartfile in the root folder of your project.\n```\ngithub \"uptechteam/AirBar\" ~\u003e 2.0\n```\n\nUsing [CocoaPods](https://github.com/CocoaPods/CocoaPods) add following line to your project Podfile\n```\npod 'AirBar', '~\u003e 2.0'\n```\n\nUsing `Swift Package Manager`, add the following line to your Package.swift:\n\n```\ndependencies: [\n  .package(url: \"https://github.com/uptechteam/AirBar.git\", .exact(\"2.0.6\")),\n],\n```\n\n## How to use\n\n1) Create `BarController` object using `BarController(configuration Configuration, stateObserver: StateObserver)` initializer, where `Configuration` is struct that contains height config and `StateObserver` is closure that will be called on state change.\n\n2) Bind `BarController` to your `UIScrollView` object using `set(scrollView: UIScrollView)` method. \n\n3) Provide UI transformations in closure passed as `StateObserver` init argument. Closure will receive `State` object that has following public methods:\n- `height()` - returns bar height;\n- `transitionProgress()` - returns bar transition progress between 0 and 2, where 0 - compact state, 1 - normal state, 2 - expanded state;\n- `value(compactNormalRange: ValueRangeType, normalExpandedRange: ValueRangeType)` - returns transformed CGFloat value that can be used for configuring UIKit element properties. `ValueRangeType` is enum with `.range(CGFloat, CGFloat)` and `.value(CGFloat)` cases. You can use it for example if you need static value `1` in normal-expanded transition and range (0, 1) in compact-normal transition.\n\n4) (Optional) Contribute to repository.\n\nAlso you can find example application in library project.\n\n## Multiple UIScrollView objects\n`BarController` supports using multiple `UIScrollView` objects. You can use `preconfigure(scrollView: UIScrollView)` method to configure scrolling view before setting it with `set(scrollView: UIScrollView)` method. \n\n## TODO\n- Implement expansion/concatination resistance;\n- ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptechteam%2FAirBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuptechteam%2FAirBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptechteam%2FAirBar/lists"}