{"id":17078645,"url":"https://github.com/marty-suzuki/pickerbutton","last_synced_at":"2025-04-12T20:34:29.096Z","repository":{"id":62450714,"uuid":"171155811","full_name":"marty-suzuki/PickerButton","owner":"marty-suzuki","description":"PickerButton is subclass of UIButton that presents UIPickerView in UIKeyboard.","archived":false,"fork":false,"pushed_at":"2021-02-08T11:37:37.000Z","size":6212,"stargazers_count":45,"open_issues_count":3,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T01:48:46.335Z","etag":null,"topics":["ios","keyboard","uibutton","uipickerview"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/marty-suzuki.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":"2019-02-17T18:19:25.000Z","updated_at":"2024-12-14T04:28:28.000Z","dependencies_parsed_at":"2022-11-01T23:33:10.422Z","dependency_job_id":null,"html_url":"https://github.com/marty-suzuki/PickerButton","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FPickerButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FPickerButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FPickerButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty-suzuki%2FPickerButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marty-suzuki","download_url":"https://codeload.github.com/marty-suzuki/PickerButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631043,"owners_count":21136547,"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":["ios","keyboard","uibutton","uipickerview"],"created_at":"2024-10-14T12:22:55.029Z","updated_at":"2025-04-12T20:34:29.075Z","avatar_url":"https://github.com/marty-suzuki.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PickerButton\n\n[![Platform](http://img.shields.io/badge/platform-iOS-blue.svg?style=flat\n)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/swift-4.2-orange.svg?style=flat\n)](https://developer.apple.com/swift)\n[![Version](https://img.shields.io/cocoapods/v/PickerButton.svg?style=flat)](http://cocoapods.org/pods/PickerButton)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License](https://img.shields.io/cocoapods/l/MisterFusion.svg?style=flat)](http://cocoapods.org/pods/MisterFusion)\n\nPickerButton is subclass of UIButton that presents UIPickerView in keyboard.\n\n![](./Images/picker.gif)\n\n## Concept\n\nWhen PickerButton is tapped, it presents UIPickerView on UIKeyboard.\n\n| PickerButton | inputView | inputAccessoryView |\n| :-: | :-: | :-: |\n| PickerButton is in conformity to [UIKeyInput](https://developer.apple.com/documentation/uikit/uikeyinput). | PickerButton returns UIPickerView as [inputView](https://developer.apple.com/documentation/uikit/uiresponder/1621092-inputview). | PickerButton returns UIToolBar as [inputAccessoryView](https://developer.apple.com/documentation/uikit/uiresponder/1621119-inputaccessoryview). |\n| ![](./Images/button.jpg) | ![](./Images/picker.jpg) | ![](./Images/inputview.jpg) |\n\n\nWhen selected row or component is changed, button title is automatically updated.\n\n\n## Usage\n\nPickerButton is almost same interface as UIPickerView.\n\n```swift\nclass ViewController: UIViewController {\n\n    @IBOutlet weak var button: PickerButton!\n\n    let pickerValues: [String] = [\"first\", \"second\", \"third\"]\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        button.delegate = self\n        button.dataSource = self\n    }\n}\n\nextension ViewController: UIPickerViewDelegate, UIPickerViewDataSource {\n\n    func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -\u003e String? {\n        return pickerValues[row]\n    }\n\n    func numberOfComponents(in pickerView: UIPickerView) -\u003e Int {\n        return 1\n    }\n\n    func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -\u003e Int {\n        return pickerValues.count\n    }\n}\n```\n\nTo use PickerButton in Storyboard / Xib, set Custom Class to `PickerButton`.\n\n![](./Images/storyboard.png)\n\n## Requirements\n\n- Swift 4.2\n- Xcode 10.1 or greater\n- iOS 10.0 or greater\n\n## Installation\n\n#### CocoaPods\n\nPickerButton is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"PickerButton\"\n```\n\n#### Carthage\n\nIf you’re using [Carthage](https://github.com/Carthage/Carthage), simply add\nPickerButton to your `Cartfile`:\n\n```\ngithub \"marty-suzuki/PickerButton\"\n```\n\nMake sure to add `PickerButton.framework` to \"Linked Frameworks and Libraries\" and \"copy-frameworks\" Build Phases.\n\n## Author\n\nmarty-suzuki, s1180183@gmail.com\n\n## License\n\nPickerButton 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%2Fmarty-suzuki%2Fpickerbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarty-suzuki%2Fpickerbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarty-suzuki%2Fpickerbutton/lists"}