[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7120":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":27,"discoverSource":28},7120,"DropDown","AssistoLab\u002FDropDown","AssistoLab","A Material Design drop down for iOS","",null,"Swift",2547,653,38,184,0,2,60.65,"MIT License",false,"master",true,[],"2026-06-12 04:00:32","![DropDown](Screenshots\u002Flogo.png)\n\n[![Twitter: @kevinh6113](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcontact-%40kevinh6113-70a1fb.svg?style=flat)](https:\u002F\u002Ftwitter.com\u002Fkevinh6113)\n[![License: MIT](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-70a1fb.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FAssistoLab\u002FDropDown\u002Fblob\u002Fmaster\u002FREADME.md)\n[![Version](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-2.3.13-green.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FAssistoLab\u002FDropDown)\n[![Cocoapods](http:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCocoapods-available-green.svg?style=flat)](http:\u002F\u002Fcocoadocs.org\u002Fdocsets\u002FDropDown\u002F)\n[![Carthage compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCarthage-compatible-4BC51D.svg?style=flat)](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage)\n\n\nA Material Design drop down for iOS written in Swift.\n***\n\n[![](Screenshots\u002F1.png)](Screenshots\u002F1.png)\n[![](Screenshots\u002F2.png)](Screenshots\u002F2.png)\n[![](Screenshots\u002F3.png)](Screenshots\u002F3.png)\n\n## Demo\n\nDo `pod try DropDown` in your console and run the project to try a demo.\nTo install [CocoaPods](http:\u002F\u002Fwww.cocoapods.org), run `sudo gem install cocoapods` in your console.\n\n## Installation 📱\n\n`DropDown` supports Swift 5.0 since version `2.3.13`.\n`DropDown` supports Swift 4.2 since version `2.3.4`.\n\nIf you need Swift 4.0, use version 2.3.2:\n- Manually: use tag `2.3.2`\n- CocoaPods: `pod 'DropDown', '2.3.2'`\n- Carthage: `github \"AssistoLab\u002FDropDown\" == 2.3.2`\n\n### CocoaPods\n\nUse [CocoaPods](http:\u002F\u002Fwww.cocoapods.org).\n\n1. Add `pod 'DropDown'` to your *Podfile*.\n2. Install the pod(s) by running `pod install`.\n3. Add `import DropDown` in the .swift files where you want to use it\n\n### Carthage\n\nUse [Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage).\n\n1. Create a file name `Cartfile`.\n2. Add the line `github \"AssistoLab\u002FDropDown\"`.\n3. Run `carthage update`.\n4. Drag the built `DropDown.framework` into your Xcode project.\n\n### Source files\n\nA regular way to use DropDown in your project would be using Embedded Framework. There are two approaches, using source code and adding submodule.\n\nAdd source code:\n\n1. Download the [latest code version](http:\u002F\u002Fgithub.com\u002FAssistoLab\u002FDropDown\u002Farchive\u002Fmaster.zip).\n2. Unzip the download file, copy `DropDown` folder to your project folder\n\nAdd submodule\n\n1. In your favorite terminal, `cd` into your top-level project directory, and entering the following command:\n``` bash\n$ git submodule add git@github.com:AssistoLab\u002FDropDown.git\n```\n\nAfter you get the source code either by adding it directly or using submodule, then do the following steps:\n\n- Open `DropDown` folder, and drag `DropDown.xcodeproj` into the file navigator of your app project, under you app project.\n- In Xcode, navigate to the target configuration window by clicking the blue project icon, and selecting the application target under the \"Targets\" heading in the sidebar.\n- Open \"Build Phases\" panel in the tab bar at the top of the window, expend the \"Target Dependencies\" group and add `DropDown.framework` under DropDown icon in the popup window by clicking `+`. Similarly, you can also add `DropDown.framework` in \"Embedded Binaries\" under \"General\" tab.\n\n## Basic usage ✨\n\n```swift\nlet dropDown = DropDown()\n\n\u002F\u002F The view to which the drop down will appear on\ndropDown.anchorView = view \u002F\u002F UIView or UIBarButtonItem\n\n\u002F\u002F The list of items to display. Can be changed dynamically\ndropDown.dataSource = [\"Car\", \"Motorcycle\", \"Truck\"]\n```\n\nOptional properties:\n\n```swift\n\u002F\u002F Action triggered on selection\ndropDown.selectionAction = { [unowned self] (index: Int, item: String) in\n  print(\"Selected item: \\(item) at index: \\(index)\")\n}\n\n\u002F\u002F Will set a custom width instead of the anchor view width\ndropDownLeft.width = 200\n```\n\nDisplay actions:\n\n```swift\ndropDown.show()\ndropDown.hide()\n```\n\n## Important ⚠️\n\nDon't forget to put:\n\n```swift\nDropDown.startListeningToKeyboard()\n```\n\nin your `AppDelegate`'s `didFinishLaunching` method so that the drop down will handle its display with the keyboard displayed even the first time a drop down is showed.\n\n## Advanced usage 🛠\n\n### Direction\n\nThe drop down can be shown below or above the anchor view with:\n```swift\ndropDown.direction = .any\n```\n\nWith `.any` the drop down will try to displa itself below the anchor view when possible, otherwise above if there is more place than below.\nYou can restrict the possible directions by using `.top` or `.bottom`.\n\n### Offset\n\nBy default, the drop down will be shown onto to anchor view. It will hide it.\nIf you need the drop down to be below your anchor view when the direction of the drop down is `.bottom`, you can precise an offset like this:\n\n```swift\n\u002F\u002F Top of drop down will be below the anchorView\ndropDown.bottomOffset = CGPoint(x: 0, y:(dropDown.anchorView?.plainView.bounds.height)!)\n```\n\nIf you set the drop down direction to `.any` or `.top` you can also precise the offset when the drop down will shown above like this:\n\n```swift\n\u002F\u002F When drop down is displayed with `Direction.top`, it will be above the anchorView\ndropDown.topOffset = CGPoint(x: 0, y:-(dropDown.anchorView?.plainView.bounds.height)!)\n```\n*Note the minus sign here that is use to offset to the top.*\n\n### Cell configuration\n\n#### Formatted text\n\nBy default, the cells in the drop down have the `dataSource` values as text.\nIf you want a custom formatted text for the cells, you can set `cellConfiguration` like this:\n\n```swift\ndropDown.cellConfiguration = { [unowned self] (index, item) in\n  return \"- \\(item) (option \\(index))\"\n}\n```\n\n#### Custom cell\n\nYou can also create your own custom cell, from your .xib file. To have something like this for example:\n\u003Cbr\u002F>[![](Screenshots\u002F3.png)](Screenshots\u002F3.png)\n\nYou can check out a concrete example in the Demo inside this project (go to `ViewController.swift`, line 125).\n\nFor this you have to:\n\n- Create a [`DropDownCell`](DropDown\u002Fsrc\u002FDropDownCell.swift) subclass (e.g. *MyCell.swift*)\n```swift\nclass MyCell: DropDownCell {\n   @IBOutlet weak var logoImageView: UIImageView!\n}\n```\n- Create your custom xib (e.g. *MyCell.xib*) and design your cell view in it\n- Link the cell in your xib to your custom class\n- At least have a label in your xib to link to the [`optionLabel`](DropDown\u002Fsrc\u002FDropDownCell.swift#L14) `IBOutlet` in code (`optionLabel` is a property of `DropDownCell`)\n\u003Cbr\u002F>[![](Screenshots\u002FcustomCells\u002Flinks.png)](Screenshots\u002FcustomCells\u002Flinks.png)\n\u003Cbr\u002F>[![](Screenshots\u002FcustomCells\u002Fxib.png)](Screenshots\u002FcustomCells\u002Fxib.png)\n- Then, you simply need to do this:\n```swift\nlet dropDown = DropDown()\n\n\u002F\u002F The view to which the drop down will appear on\ndropDown.anchorView = view \u002F\u002F UIView or UIBarButtonItem\n\n\u002F\u002F The list of items to display. Can be changed dynamically\ndropDown.dataSource = [\"Car\", \"Motorcycle\", \"Truck\"]\n\n\u002F*** IMPORTANT PART FOR CUSTOM CELLS ***\u002F\ndropDown.cellNib = UINib(nibName: \"MyCell\", bundle: nil)\n\ndropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in\n   guard let cell = cell as? MyCell else { return }\n\n   \u002F\u002F Setup your custom UI components\n   cell.logoImageView.image = UIImage(named: \"logo_\\(index)\")\n}\n\u002F*** END - IMPORTANT PART FOR CUSTOM CELLS ***\u002F\n```\n- And you're good to go! 🙆\n\nFor a complete example, don't hesitate to check the demo app and code.\n\n### Events\n\n```swift\ndropDown.cancelAction = { [unowned self] in\n  println(\"Drop down dismissed\")\n}\n\ndropDown.willShowAction = { [unowned self] in\n  println(\"Drop down will show\")\n}\n```\n\n### Dismiss modes\n\n```swift\ndropDown.dismissMode = .onTap\n```\n\nYou have 3 dismiss mode with the `DismissMode` enum:\n\n- `onTap`: A tap oustide the drop down is needed to dismiss it (Default)\n- `automatic`: No tap is needed to dismiss the drop down. As soon as the user interact with anything else than the drop down, the drop down is dismissed\n- `manual`: The drop down can only be dismissed manually (in code)\n\n### Others\n\nYou can manually (pre)select a row with:\n\n```swift\ndropDown.selectRow(at: 3)\n```\n\nThe data source is reloaded automatically when changing the `dataSource` property.\nIf needed, you can reload the data source manually by doing:\n\n```swift\ndropDown.reloadAllComponents()\n```\n\nYou can get info about the selected item at any time with this:\n\n```swift\ndropDown.selectedItem \u002F\u002F String?\ndropDown.indexForSelectedRow \u002F\u002F Int?\n```\n\n## Customize UI 🖌\n\nYou can customize these properties of the drop down:\n\n- `textFont`: the font of the text for each cells of the drop down.\n- `textColor`: the color of the text for each cells of the drop down.\n- `selectedTextColor`: the color of the text for selected cells of the drop down.\n- `backgroundColor`: the background color of the drop down.\n- `selectionBackgroundColor`: the background color of the selected cell in the drop down.\n- `cellHeight`: the height of the drop down cells.\n- `dimmedBackgroundColor`: the color of the background (behind the drop down, covering the entire screen).\n- `cornerRadius`: the corner radius of the drop down (see [info](#Issues) below if you encounter any issue)\n- `setupMaskedCorners`: the masked corners of the dropdown. Use this along with `cornerRadius` to set the corner radius only on certain corners.\n\nYou can change them through each instance of `DropDown` or via `UIAppearance` like this for example:\n\n```swift\nDropDown.appearance().textColor = UIColor.black\nDropDown.appearance().selectedTextColor = UIColor.red\nDropDown.appearance().textFont = UIFont.systemFont(ofSize: 15)\nDropDown.appearance().backgroundColor = UIColor.white\nDropDown.appearance().selectionBackgroundColor = UIColor.lightGray\nDropDown.appearance().cellHeight = 60\n```\n\n## Expert mode 🤓\n\nwhen calling the `show` method, it returns a tuple like this:\n\n```swift\n(canBeDisplayed: Bool, offscreenHeight: CGFloat?)\n```\n\n- `canBeDisplayed`: Tells if there is enough height to display the drop down. If its value is `false`, the drop down is not showed.\n- `offscreenHeight`: If the drop down was not able to show all cells from the data source at once, `offscreenHeight` will contain the height needed to display all cells at once (without having to scroll through them). This can be used in a scroll view or table view to scroll enough before showing the drop down.\n\n## Issues\n\nIf you experience the compiler error *\"Ambiguous use of 'cornerRadius'\"* on line:\n```swift\nDropDown.appearance().cornerRadius = 10\n```\n\nPlease use intead:\n```swift\nDropDown.appearance().setupCornerRadius(10) \u002F\u002F available since v2.3.6\n```\n\n## Requirements\n\n* Xcode 8+\n* Swift 3.0\n* iOS 8+\n* ARC\n\n## License\n\nThis project is under MIT license. For more information, see `LICENSE` file.\n\n## Credits\n\nDropDown was inspired by the Material Design version of the [Simple Menu](http:\u002F\u002Fwww.google.com\u002Fdesign\u002Fspec\u002Fcomponents\u002Fmenus.html#menus-simple-menus).\n\nDropDown was done to integrate in a project I work on:\u003Cbr\u002F>\n[![Assisto](https:\u002F\u002Fassis.to\u002Fimages\u002Flogouser_dark.png)](https:\u002F\u002Fassis.to)\n\nIt will be updated when necessary and fixes will be done as soon as discovered to keep it up to date.\n\nI work at\u003Cbr\u002F>\n[![Pinch](http:\u002F\u002Fpinch.eu\u002Fimg\u002Fpinch-logo.png)](http:\u002F\u002Fpinch.eu)\n\nYou can find me on Twitter [@kevinh6113](https:\u002F\u002Ftwitter.com\u002Fkevinh6113).\n\nEnjoy!\n","DropDown 是一个为 iOS 设计的 Material Design 下拉菜单库，采用 Swift 语言编写。该项目提供了简洁美观的下拉选择功能，并支持多种安装方式如 CocoaPods、Carthage 和手动添加源码等，便于开发者集成到自己的项目中。其核心特点包括高度可定制性以及与 Material Design 指南的高度一致性，能够帮助应用在保持一致性的视觉风格的同时提升用户体验。适用于需要在 iOS 应用程序中实现优雅下拉列表选择功能的各种场景。","2026-06-11 03:10:38","top_language"]