Latest0.2.3
Homepagehttps://github.com/jriosdev/iOSDropDown
LicenseMIT
Platformsios 8.0
FrameworksUIKit
Authors

iOS DropDown

Version
Cocoapods
Swift 4.0
License
Platform
[Star]()

Drop Down With Search for iOS

It’s a Swift Library to support Drop Down Menu in iOS

Support Search and Return Correct index

iOSDropDown

Customizing

iOSDropDown

hideOptionWhenSelect = false

iOSDropDown

Example

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

Features

  1. Simple UITextField Extension And simple to use , We can Access all properties of UITextField
    iOSDropDown
  2. DropDown Search can enable or disable
  3. Change color of List background and selected color
  4. Change Maximum Hieght of List and Height of each Row

Installation

CocoaPods

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

  1. Add pod 'iOSDropDown' to your Podfile.
  2. Install the pod(s) by running pod install.
  3. Add iOSDropDown.framework in Build Phases > Link Binary with Libraries
  4. Add import iOSDropDown in the .swift files where you want to use it

Carthage

Use Carthage.

  1. Create a file name Cartfile.
  2. Add the line github "jriosdev/iOSDropDown".
  3. Run carthage update.
  4. Drag the built iOSDropDown.framework into your Xcode project.

Manual

Just clone and add the following Swift files to your project:

  • iOSDropDown.swfit

Basic usage ✨

StoryBoard Method

Simply add UITextField to Your ViewCOntroller And Connect @IBOutlet – DropDown Class

iOSDropDown


@IBOutlet weak var dropDown : DropDown!

// The list of array to display. Can be changed dynamically
dropDown.optionArray = ["Option 1", "Option 2", "Option 3"]
//Its Id Values and its optional
dropDown.optionIds = [1,23,54,22] 
// The the Closure returns Selected Index and String 
dropDown.didSelect{(selectedText , index ,id) in
self.valueLabel.text = "Selected String: (selectedText) n index: (index)"
}

OR

Code Method

let  dropDown = DropDown(frame: CGRect(x: 110, y: 140, width: 200, height: 30)) // set frame

// The list of array to display. Can be changed dynamically
dropDown.optionArray = ["Option 1", "Option 2", "Option 3"]
// Its Id Values and its optional
dropDown.optionIds = [1,23,54,22] 
// The the Closure returns Selected Index and String 
dropDown.didSelect{(selectedText , index ,id) in
self.valueLabel.text = "Selected String: (selectedText) n index: (index)"
    }
}

Other Options

Actions

    dropDown.showList()  // To show the Drop Down Menu
    dropDown.hideList() // To hide the Drop Down Menu

Closures

  listWillAppear() {
   //You can Do anything when iOS DropDown willAppear 
  }

 listDidAppear() {
     //You can Do anything when iOS DropDown listDidAppear
 }

 listWillDisappear() {
   //You can Do anything when iOS DropDown listWillDisappear 
 }

  listDidDisappear() {
   //You can Do anything when iOS DropDown listDidDisappear
 }

Customize iOSDropDown 🖌

You can customize these properties of the drop down:

  • isSearchEnabled : You can Enable or Disable on DropDown .Default value Is true
  • hideOptionsWhenSelect : This option to hide the list when click option one item. Default value is true
  • selectedRowColor : Color of selected Row item in DropDown Default value is .cyan
  • rowBackgroundColor : Color of DropDown Default value is .white
  • listHeight: The maximum Height of of List. Default value is 150
  • rowHeight: The Height of of List in the List. Default value is 30
  • Alingment and Fonts are same as TextField You Can change it

Note :

If you are using Multiple Drop Downs in a Single ViewController, Must Kept reverse order on StoryBoard or addSubview()  to avoid Overlaying

Author

✨✨If you like my project please Give me a STAR on Github✨✨

Jishnu Raj T, [email protected]
Contact

License

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

Latest podspec

{
    "name": "iOSDropDown",
    "version": "0.2.3",
    "summary": "iOSDropDown is an Awesome DropDown Library with Search and other customization options",
    "swift_version": "4.0",
    "description": "iOSDropDown is an Awesome Drop Down Menu Library with Search & other customization options For iOS",
    "homepage": "https://github.com/jriosdev/iOSDropDown",
    "screenshots": [
        "https://raw.githubusercontent.com/jriosdev/iOSDropDown/master/images/1.gif",
        "https://raw.githubusercontent.com/jriosdev/iOSDropDown/master/images/2.gif"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jishnu Raj T": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jriosdev/iOSDropDown.git",
        "tag": "0.2.3"
    },
    "social_media_url": "https://twitter.com/jishnurajt",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "iOSDropDown/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This