uid

UIDropDown

An elegant dropdown for iOS written in Swift.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

86

Maintenance

Last Commit

5yrs ago

Contributors

3

Package

Dependencies

0

License

MIT

Categories

Readme

UIDropDown

An elegant dropdown for iOS written in Swift.

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, igongoracastano@gmail.com

License

UIDropDown is available under the MIT license

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial