{"id":18448384,"url":"https://github.com/darkseal/downpicker","last_synced_at":"2025-04-07T12:07:26.002Z","repository":{"id":29515591,"uuid":"33053975","full_name":"Darkseal/DownPicker","owner":"Darkseal","description":"A lightweight DropDownList / ComboBox for iOS, written in Objective-C","archived":false,"fork":false,"pushed_at":"2021-07-19T14:10:43.000Z","size":213,"stargazers_count":202,"open_issues_count":21,"forks_count":54,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-31T10:09:46.467Z","etag":null,"topics":["cocoapods","control-wrapper","dropdownlist","ios","objective-c","uitextfield"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Darkseal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-28T23:15:03.000Z","updated_at":"2023-09-30T18:35:53.000Z","dependencies_parsed_at":"2022-09-02T14:32:09.096Z","dependency_job_id":null,"html_url":"https://github.com/Darkseal/DownPicker","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkseal%2FDownPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkseal%2FDownPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkseal%2FDownPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Darkseal%2FDownPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Darkseal","download_url":"https://codeload.github.com/Darkseal/DownPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","control-wrapper","dropdownlist","ios","objective-c","uitextfield"],"created_at":"2024-11-06T07:15:45.605Z","updated_at":"2025-04-07T12:07:25.979Z","avatar_url":"https://github.com/Darkseal.png","language":"Objective-C","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=F576E73P5X526"],"categories":[],"sub_categories":[],"readme":"# DownPicker\n\nDownPicker is an extremely light-weight class library for creating *DropDownList* / *ComboBox* controls for iOS that will behave like their HTML / Android counterparts.\nYou'll only need a standard **UITextField** and few lines of code.\n\n\n## What does it do\n\nIt takes any **UITextField** already present in your code (including those added to a *Storyboard*):\n\n![alt text](https://raw.githubusercontent.com/Darkseal/DownPicker/gh-pages/images/DownPicker/UITextField.base.png \"Here's a standard UITextField\")\n\nand turns it into this:\n\n![alt text](https://raw.githubusercontent.com/Darkseal/DownPicker/gh-pages/images/DownPicker/UITextField.DownPicker.png \"Here's a DownPicker control\")\n\nIt's as simple as that. You only need to provide an array of data.\n\n**NOTE**: If you don't like the *control wrapper* approach, you can also use it as a *custom control* via the included **UIDownPicker** class: read the following paragraph for more info.\n\n\n## How does it work\n\nDownPicker is basically a *control interface wrapper*, meaning that you won't use it as a control - it will use an existing UITextField control instead.\nThis is a good thing, because you'll be able to design, positioning and skin your UITextField like you always do, programmatically or inside a *Storyboard* UI, depending on how you are used to work. You won't change your style, as it will adapt to suit yours.\n\nHowever, if you don't like the *control wrapper* pattern, you can just use it as a *custom control* using the included **UIDownPicker** class. It's entirely up to you (and very easy to install in both scenarios).\n\n\n## Installation\n\n### Using CocoaPods\n\nDownPicker is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n`pod \"DownPicker\"`\n\n[![CI Status](http://img.shields.io/travis/Darkseal/DownPicker.svg?style=flat)](https://travis-ci.org/Darkseal/DownPicker)\n[![Version](https://img.shields.io/cocoapods/v/DownPicker.svg?style=flat)](http://cocoapods.org/pods/DownPicker)\n[![License](https://img.shields.io/cocoapods/l/DownPicker.svg?style=flat)](http://cocoapods.org/pods/DownPicker)\n[![Platform](https://img.shields.io/cocoapods/p/DownPicker.svg?style=flat)](http://cocoapods.org/pods/DownPicker)\n\n### Manual Installation\n\nDownload the latest version from [this link](https://github.com/Darkseal/DownPicker/archive/master.zip), \nthen unzip \u0026 drag-drop the /DownPicker/ folder inside your iOS project. You can do that directly within Xcode,\njust be sure you have the **copy items if needed** and the **create groups** options checked.\n\n\n## How to Use\n\nOnce you have DownPicker installed and included in your project, you can either use it as a Control Wrapper or as a Custom Control: the choice is up to you, depending on your programming style.\n\n### As a Control Wrapper\n\nAdd (or choose) a **UITextField** you would like to transform to a DownPicker. You can use the Storyboard designer tool or do it programmatically; you can also set up constraints, custom placement/coords, font, colors and anything else you like. When you're done, open your controller's .h file and create a property for the DownPicker wrapper:\n\n    #import \"DownPicker.h\";\n\n    @property (strong, nonatomic) DownPicker *downPicker;\n\nThen switch to the .m file and add these lines to your controller's **viewDidAppear** method:\n\n    // create the array of data\n    NSMutableArray* bandArray = [[NSMutableArray alloc] init];\n\n    // add some sample data\n    [bandArray addObject:@\"Offsprings\"];\n    [bandArray addObject:@\"Radiohead\"];\n    [bandArray addObject:@\"Muse\"];\n    [bandArray addObject:@\"R.E.M.\"];\n    [bandArray addObject:@\"The Killers\"];\n    [bandArray addObject:@\"Social Distortion\"];\n\n    // bind yourTextField to DownPicker\n    self.downPicker = [[DownPicker alloc] initWithTextField:self.yourTextField withData:bandArray];\n\nThat's it. You can retrieve the user's choice at any time using `self.datePicker.text` or `textField.text`.\n\n### As a Custom Control\nIf you'd like to use DownPicker as a custom control instead, just instantiate the included **UIDownPicker** class programmatically and attach it to your view like any other legacy UI control:\n\n    @interface YourViewController () {\n        UIDownPicker *_dp;\n    }\n    @end\n\n    @end\n    - (void)viewDidLoad\n    {\n        [super viewDidLoad];\n        self._dp = [[UIDownPicker] initWithData:yourMutableArray];\n        [self.view addSubview:self._dp]; \n    }\n    \nYou can then customize it using the inner DownPicker public property.\n\n## Status Change event handling\nYou can bind your own delegate function to DownPicker's status change by using the `UIControlEventValueChanged` Control action in the following way:\n\n    [self.yourDownPicker addTarget:self \n        action:@selector(dp_Selected:)\n        forControlEvents:UIControlEventValueChanged];\n\nand then:\n\n    -(void)dp_Selected:(id)dp {\n        NSString* selectedValue = [self.youtDownPicker text];\n        // do what you want\n    }\n\n\n## Additional Features\n\nYou can also:\n- defer data loading using the `[self.downPicker setData:array]` method.\n- disable the right arrow image using the `[self.downPicker showArrowImage:bool]` method.\n- use a custom right arrow image using the `[self.downPicker setArrowImage:UIImage*]` method. \nYou can use `[UIImage imageNamed:@\"yourCustomImage.png\"]` to set any image in your project.\n- configure (and/or localize) the placeholder text string using the `[self.downPicker setPlaceholder:NSString*]` and `[self.downPicker setPlaceholderWhileSelecting:NSString]` methods.\n- retrieve, customize and hook on the inner **UIPickerView** control using the `[self.downPicker getPickerView]` method (use at your own risk).\n- retrieve, customize and hook on the inner **UITextField** control using the `[self.downPicker getTextField]` method (use at your own risk). Remember that it's the exact same control you passed, so you might prefer to use your main reference instead.\n- the cancel button can be removed if the boolean flag property `shouldDisplayCancelButton` is set to `NO` after DownPicker is instantiated\n\n## Upcoming Features\n\n- More customization options (give me your suggestions).\n- Dynamic data-binding.\n... and more!\n\n\n## Useful Links\n- [DownPicker project page](http://darkseal.github.io/DownPicker/) on [GitHub](https://github.com)\n- [DownPicker main repository](https://github.com/Darkseal/DownPicker) on [GitHub](https://github.com)\n- [DownPicker pod page](http://cocoapods.org/pods/DownPicker) at [CocoaPods](http://cocoapods.org/)\n- [DownPicker project page](https://www.cocoacontrols.com/controls/downpicker) at [CocoaControls](https://www.cocoacontrols.com)\n- [DownPicker developer page](http://www.ryadel.com/works/downpicker/) at [Ryadel.com](http://www.ryadel.com/)\n- [DownPicker installation guide](http://www.ryadel.com/downpicker-dropdownlist-combobox-ios-xcode-in-objective-c/) at [Ryadel.com](http://www.ryadel.com/)\n- [Donation \u0026 support page](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=F576E73P5X526)\n\n\n## Support\n\nYou can support this project's development by clicking on the following button.\n\n[\u003cimg src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif\" border=\"0\" alt=\"Donate\"\u003e](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=F576E73P5X526)\n\nThanks a lot!\n\n\n## Author\n\nRyan, ryan@ryadel.com\n\n\n## License\n\nDownPicker is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkseal%2Fdownpicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkseal%2Fdownpicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkseal%2Fdownpicker/lists"}