• Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

iOS下拉菜单,也可以实现类似NSComboBox的效果

ZHDropDownMenu

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 4.0
  • iOS 8+

Useage

  1. drag a view into Storyboard, and set its class to ZHDropDownMenu

  1. set options & other properties

    menu.options = ["1992","1993","1994","1995","1996","1997","1998"]//设置下拉列表项数据
    menu.defaultValue = "1992" //设置默认值
    menu.editable = false //禁止编辑
    menu.showBorder = false //不显示边框
    menu.delegate = self //设置代理
    
  2. Implement the delegate

    //选择完后回调
    func dropDownMenu(menu: ZHDropDownMenu!, didChoose index: Int) {
        print("\(menu) choosed at index \(index)")
    }
    
    //编辑完成后回调
    func dropDownMenu(menu: ZHDropDownMenu!, didInput text: String!) {
        print("\(menu) input text \(text)")
    }
    

Installation

ZHDropDownMenu is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ZHDropDownMenu'

Author

[email protected]

License

ZHDropDownMenu is available under the MIT license. See the LICENSE file for more info.