CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

BSDropdown 2.0.3

BSDropdown 2.0.3

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2017
SPMSupports SPM

Maintained by Bobby Stenly Irawan.



  • By
  • Bobby Stenly

BSDropdown

Usage

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

Installation

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

pod "BSDropdown"

How To Use

First thing first, you need to create the BSDropdown element. If you are using the storyboard or xib, create a UIButton then change the class name to BSDropdown and the module to BSDropdown. Please set the viewController attribute and run the setup function.

self.bsdFirst.viewController = self
self.bsdFirst.title = "First Dropdown"
self.bsdFirst.defaultTitle = "Default"
self.bsdFirst.setup()

You can add some data by calling the setDataSource function.

let firstOptions = NSMutableArray()
firstOptions.addObject(["title" : "Option 1", "value" : "opt 1"])
firstOptions.addObject(["title" : "Option 2", "value" : "opt 2"])
firstOptions.addObject(["title" : "Option 3", "value" : "opt 3"])
self.bsdFirst.setDataSource(firstOptions)

If you have a lot of options, you can add a search box too.

self.bsdFirst.viewController = self
self.bsdFirst.title = "First Dropdown"
self.bsdFirst.defaultTitle = "Default"
self.bsdFirst.enableSearch = true
self.bsdFirst.setup()

Author

Bobby Stenly, [email protected]

License

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