{"id":2614,"url":"https://github.com/Azuritul/AZDropdownMenu","last_synced_at":"2025-08-03T00:32:04.963Z","repository":{"id":56901400,"uuid":"49143064","full_name":"Azuritul/AZDropdownMenu","owner":"Azuritul","description":"A simple dropdown menu component for iPhone","archived":true,"fork":false,"pushed_at":"2018-12-27T04:51:09.000Z","size":170,"stargazers_count":193,"open_issues_count":15,"forks_count":50,"subscribers_count":9,"default_branch":"develop","last_synced_at":"2024-10-29T11:06:32.231Z","etag":null,"topics":["dropdown","menu","menu-navigation","swift"],"latest_commit_sha":null,"homepage":"http://azuritul.github.io/AZDropdownMenu","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/Azuritul.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-01-06T15:23:16.000Z","updated_at":"2024-03-31T12:32:18.000Z","dependencies_parsed_at":"2022-08-21T02:20:57.831Z","dependency_job_id":null,"html_url":"https://github.com/Azuritul/AZDropdownMenu","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azuritul%2FAZDropdownMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azuritul%2FAZDropdownMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azuritul%2FAZDropdownMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azuritul%2FAZDropdownMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azuritul","download_url":"https://codeload.github.com/Azuritul/AZDropdownMenu/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228510738,"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":["dropdown","menu","menu-navigation","swift"],"created_at":"2024-01-05T20:16:18.368Z","updated_at":"2024-12-06T18:30:36.389Z","avatar_url":"https://github.com/Azuritul.png","language":"Swift","funding_links":[],"categories":["UI"],"sub_categories":["Menu","Layout","Other free courses"],"readme":"# AZDropdownMenu\n\n[![Build Status](https://www.bitrise.io/app/1dcd88cfb9a0f14e.svg?token=-Rs7yi0wHvWCFAZzx977JA)](https://www.bitrise.io/app/1dcd88cfb9a0f14e)\n[![Version](https://img.shields.io/cocoapods/v/AZDropdownMenu.svg?style=flat)](http://cocoapods.org/pods/AZDropdownMenu)\n[![License](https://img.shields.io/cocoapods/l/AZDropdownMenu.svg?style=flat)](http://cocoapods.org/pods/AZDropdownMenu)\n[![Platform](https://img.shields.io/cocoapods/p/AZDropdownMenu.svg?style=flat)](http://cocoapods.org/pods/AZDropdownMenu)\n[![Language](https://img.shields.io/badge/swift-4-orange.svg)](http://swift.org)\n\nAZDropdownMenu is a simple dropdown menu component that supports Swift.\n\n## Screenshots\nCode used in the screencast are included in the bundled sample project.\n\n![screencast](https://cloud.githubusercontent.com/assets/879197/13528338/455c738a-e250-11e5-8671-312aa58a63e1.gif)\n\n## Demo Project\n\nTo run the demo project, clone the repo with `git clone https://github.com/Azuritul/AZDropdownMenu.git`, and run `pod install` from the Example directory first.\n\n## Requirements\n- iOS 8 or above\n- Xcode 8 or above\n- Swift 3\n\n## Installation\n\nAZDropdownMenu is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\nuse_frameworks!\npod 'AZDropdownMenu'\n```\n\nUse version 1.1.2 if you don't need Swift 4 support.\n\n## Usage\n\nDeclare an array of texts that are served as the item in the menu.\n```swift\nlet titles = [\"Action 1\", \"Action 2\", \"Action 3\"]\n```\nThen pass the array to the initializer\n```swift\nlet menu = AZDropdownMenu(titles: titles)\n```\n\nSet up so that the `UIBarButtonItem` is asso\n\n\n\nated with a function that shows the menu\n```\nlet button = UIBarButtonItem(image: UIImage(named: \"menu_image\"), style: .Plain, target: self, action: \"showDropdown\")\nnavigationItem.leftBarButtonItem = menuButton\n```\n\nCalling `public func showMenuFromView(view:UIView)` can then show the menu.\n```swift\nfunc showDropdown() {\n    if (self.menu?.isDescendantOfView(self.view) == true) {\n        self.menu?.hideMenu()\n    } else {\n        self.menu?.showMenuFromView(self.view)\n    }\n}\n```\n\nThe handler `public var cellTapHandler : ((indexPath:NSIndexPath) -\u003e Void)?` would be called\nwhen menu item is tapped. So place code in here to do whatever you want. For example\n\n```swift\nmenu.cellTapHandler = { [weak self] (indexPath: NSIndexPath) -\u003e Void in\n    self?.navigationController?.pushViewController(controller, animated:true)\n}\n```\n\n#### Create menu with icons\nPass in a AZDropdownMenuItemData in the initializer: `public init(dataSource:[AZDropdownMenuItemData])` and you are good to go.\n\n\u003e Take a look at the sample project in this repository to get more usage of the library.\n\n### Configurable options\nCurrently AZDropdownMenu can be customized with the following properties. More will come in the future.\n\n- `itemHeight` Row height of the menu item. Default is 44.\n- `itemColor` The background color of the menu item. Default is white.\n- `itemFontColor` The text color of the menu item. Default is black.\n- `itemFontSize` Font size of the menu item. Default is 14.0\n- `itemFont` Font used in the menu. Default is 'Helvetica'\n- `itemAlignment` The alignment of the menu item. Default is left-aligned.\n- `itemSelectionColor` The background color of the menu item while it is tapped. Default is gray.\n- `overlayAlpha` The transparency for the background overlay. Default is 0.5\n- `overlayColor` Color for the background overlay. Default is black.\n- `menuSeparatorStyle` The separator of the menu. Default is single line.\n- `menuSeparatorColor` The color of the separator. Default is light gray.\n- `itemImagePosition` The position of image in the menu. Can be positioned before or after the text. Default is `.Prefix`.\n- `shouldDismissMenuOnDrag` If set to true, menu would be dismissed on drag. Default value is `false`.\n\n## Version\n- 1.1.3\n   - Update for Swift 4 syntax\n   \n- 1.1.2\n   - Update for Swift 3 syntax\n\n- 1.1.1\n   - Update for Swift 2.2's #selector syntax\n\n- 1.1.0\n   - Added `shouldDismissMenuOnDrag` option, menu would be dismissed on drag if this option is enabled\n   - Modified the sample project with an example using `UITableView`.\n   - Added gesture handler for the menu.\n   - Extract config struct to a separate file\n   - Update readme.\n- 1.0.0\n   - Added `itemImagePosition` option, now can configure the icon position.\n   - Changed icon sets and its corresponding location in the sample project.\n   - Modified sample project's appearance a little bit.\n   - Modified sample project's structure.\n   - Added CHANGELOG.md\n- 0.6.1\n   - Update readme\n- 0.6.0\n   - Now can use icons in the menu.\n   - Added configuration options: `menuSeparatorColor`, `itemFont`\n- 0.5.3\n   - Now can configure item's background color while tapped\n\n## Credit\n- Icon used in in the sample project is [Designed by Skydesign - Freepik.com](http://www.freepik.com/free-photos-vectors/people)\n\n## Author\nChris Wu (Azuritul), azuritul@gmail.com\n\n## License\nAZDropdownMenu 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%2FAzuritul%2FAZDropdownMenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAzuritul%2FAZDropdownMenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAzuritul%2FAZDropdownMenu/lists"}