Latest 1.1.1
Homepage https://github.com/igongora/UIDropDown
License MIT
Platforms ios 8.0, requires ARC
Authors

An elegant dropdown for iOS written in Swift.

UIDropDown

Overview

UIDropDown allows you to pick an option in a table just like dropdowns in web. It contains 3 differents animations to present the options table and can be modified in many ways.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate UIDropDown into your Xcode project using CocoaPods, specify it in your Podfile:

target '<Your Target Name>' do
    pod 'UIDropDown'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate UIDropDown into your Xcode project using Carthage, specify it in your Cartfile:

github "igongora/UIDropDown"

Run carthage update to build the framework and drag the built DropDown.framework into "Embedded binaries".

Usage

Use UIDropDown it’s as easy as set the array of strings you want to show and a placeholder

drop = UIDropDown(frame: CGRect(x: 0, y: 0, width: 200, height: 30))
drop.center = CGPoint(x: self.view.frame.midX, y: self.view.frame.midY)
drop.placeholder = "Select your country..."
drop.options = ["Mexico", "USA", "England", "France", "Germany", "Spain", "Italy", "Canada"]
drop.didSelect { (option, index) in
                     self.label.text = "You just select (option) at index: (index)"
                     print("You just select: (option) at index: (index)")
               }
self.view.addSubview(drop) 

The "didSelect" method will return the string and index selected

drop.didSelect { (option, index) in
                     self.label.text = "You just select (option) at index: (index)"
                     print("You just select: (option) at index: (index)")
               }

Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3+

Author

Isaac Gongora, [email protected]

License

UIDropDown is available under the MIT license

Latest podspec

{
    "name": "UIDropDown",
    "version": "1.1.1",
    "summary": "An elegant dropdown for iOS written in Swift.",
    "description": "UIDropDown allows you to pick an option in a beautiful table just like dropdowns in web. It contains 3 tdifferents animations to present the options table and can be modified in many ways.",
    "homepage": "https://github.com/igongora/UIDropDown",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Isaac Gongora": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/igongora/UIDropDown.git",
        "tag": "1.1.1"
    },
    "source_files": "UIDropDown",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This