{"id":13507341,"url":"https://github.com/rheyansh/RPicker","last_synced_at":"2025-03-30T08:30:29.882Z","repository":{"id":45814605,"uuid":"131110567","full_name":"rheyansh/RPicker","owner":"rheyansh","description":"Simple and Easy-to-Use iOS Swift Date and Options Picker","archived":false,"fork":false,"pushed_at":"2022-04-30T09:10:00.000Z","size":1736,"stargazers_count":147,"open_issues_count":2,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-01T06:34:28.185Z","etag":null,"topics":["datepicker","ios","options-picker","optionspicker","picker","pickerview","swift"],"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/rheyansh.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":"2018-04-26T06:32:38.000Z","updated_at":"2024-10-20T11:57:11.000Z","dependencies_parsed_at":"2022-08-12T12:21:01.074Z","dependency_job_id":null,"html_url":"https://github.com/rheyansh/RPicker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rheyansh%2FRPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rheyansh%2FRPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rheyansh%2FRPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rheyansh%2FRPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rheyansh","download_url":"https://codeload.github.com/rheyansh/RPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296325,"owners_count":20754623,"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":["datepicker","ios","options-picker","optionspicker","picker","pickerview","swift"],"created_at":"2024-08-01T02:00:31.547Z","updated_at":"2025-03-30T08:30:28.926Z","avatar_url":"https://github.com/rheyansh.png","language":"Swift","funding_links":[],"categories":["Credits","OOM-Leaks-Crash"],"sub_categories":["Interfaces","Picker"],"readme":"# RPicker\nElegant and Easy-to-Use Swift Date and Options Picker.\nMaster branch has the latest code and compatible with Swift 5. Check other branches for various Swift versions\n\n# What's New\n* iOS 14 Support with various UIDatePickerStyle e.g. Wheel, Inline, Compact\n* Dark Mode and Light Mode Support\n* Objective C Support [See How to use in Objective C Heading of this file]\n\n![Alt text](https://github.com/rheyansh/RPicker/blob/master/Screenshots/1.png)\n![Alt text](https://github.com/rheyansh/RPicker/blob/master/Screenshots/2.png)\n![Alt text](https://github.com/rheyansh/RPicker/blob/master/Screenshots/3.png)\n![Alt text](https://github.com/rheyansh/RPicker/blob/master/Screenshots/4.png)\n\n# How to use\nAdd RPicker.swift into your project.\nYou are ready to go!\n\n    // Simple Date Picker\n        RPicker.selectDate {[weak self] (selectedDate) in\n            // TODO: Your implementation for date\n            self?.outputLabel.text = selectedDate.dateString(\"MMM-dd-YYYY\")\n        }\n        \n        // Simple Date Picker with title\n        RPicker.selectDate(title: \"Select Date\", didSelectDate: {[weak self] (selectedDate) in\n            // TODO: Your implementation for date\n            self?.outputLabel.text = selectedDate.dateString(\"MMM-dd-YYYY\")\n        })\n        \n        // Simple Time Picker\n        RPicker.selectDate(title: \"Select Time\", cancelText: \"Cancel\", datePickerMode: .time, didSelectDate: { [weak self](selectedDate) in\n            // TODO: Your implementation for date\n            self?.outputLabel.text = selectedDate.dateString(\"hh:mm a\")\n        })\n        \n        // Simple Date and Time Picker\n        RPicker.selectDate(title: \"Select Date \u0026 Time\", cancelText: \"Cancel\", datePickerMode: .dateAndTime, minDate: Date(), maxDate: Date().dateByAddingYears(5), didSelectDate: {[weak self] (selectedDate) in\n            // TODO: Your implementation for date\n            self?.outputLabel.text = selectedDate.dateString()\n        })\n        \n        //Show date picker with min and max date\n        RPicker.selectDate(title: \"Select Date\", minDate: Date(), maxDate: Date().dateByAddingYears(5), didSelectDate: {[weak self] (selectedDate) in\n            // TODO: Your implementation for date\n            self?.outputLabel.text = selectedDate.dateString(\"MMM-dd-YYYY\")\n        })\n        \n        // Simple Option Picker\n        let dummyList = [\"Apple\", \"Orange\", \"Banana\", \"Mango\", \"Bilberry\", \"Blackberry\"]\n\n        RPicker.selectOption(dataArray: dummyList) {[weak self] (selctedText, atIndex) in\n            // TODO: Your implementation for selection\n            self?.outputLabel.text = selctedText + \" selcted at \\(atIndex)\"\n        }\n        \n        // Simple Option Picker with selected index\n        let dummyList = [\"Apple\", \"Orange\", \"Banana\", \"Mango\"]\n        RPicker.selectOption(title: \"Select\", cancelText: \"Cancel\", dataArray: dummyList, selectedIndex: 2) {[weak self] (selctedText, atIndex) in\n            // TODO: Your implementation for selection\n            self?.outputLabel.text = selctedText + \" selcted at \\(atIndex)\"\n        }\n        \n        //Date picker with pre selected date\n        let selectedDate = Date().dateByAddingYears(-6)\n        let maxDate = Date()\n        let minDate = Date().dateByAddingYears(-12)\n        \n        RPicker.selectDate(title: \"Select\", selectedDate: selectedDate, minDate: minDate, maxDate: maxDate) { [weak self] (selectedDate) in\n            // TODO: Your implementation for date\n            self?.outputLabel.text = selectedDate.dateString(\"MMM-dd-YYYY\")\n            \n        }\n        \n       //Show date picker iOS 14 -\u003e Inline mode\n            RPicker.selectDate(title: \"Select Date\", cancelText: \"Cancel\", datePickerMode: .date, style: .Inline, didSelectDate: {[weak self] (selectedDate) in\n                // TODO: Your implementation for date\n                self?.outputLabel.text = selectedDate.dateString(\"MMM-dd-YYYY\")\n            })\n            \n            //Show time picker iOS 14 -\u003e Inline mode\n            RPicker.selectDate(title: \"Select Time\", cancelText: \"Cancel\", datePickerMode: .time, style: .Inline, didSelectDate: {[weak self] (selectedDate) in\n                // TODO: Your implementation for date\n                self?.outputLabel.text = selectedDate.dateString(\"hh:mm a\")\n            })\n            \n            //Show date and time picker iOS 14 -\u003e Inline mode\n            RPicker.selectDate(title: \"Select Date and Time\", cancelText: \"Cancel\", datePickerMode: .dateAndTime, style: .Inline, didSelectDate: {[weak self] (selectedDate) in\n                // TODO: Your implementation for date\n                self?.outputLabel.text = selectedDate.dateString()\n            })\n            \n            //Show date and time picker iOS 14 -\u003e Compact mode\n            RPicker.selectDate(title: \"Select Date and Time\", cancelText: \"Cancel\", datePickerMode: .dateAndTime, style: .Compact, didSelectDate: {[weak self] (selectedDate) in\n                // TODO: Your implementation for date\n                self?.outputLabel.text = selectedDate.dateString()\n            })\n        \n\n# How to use in Objective C\n**Date Picker**\n\n    [RPicker selectDateWithTitle:@\"Select\" cancelText:@\"Cancel\" doneText:@\"Done\" datePickerMode:UIDatePickerModeDate selectedDate:dateValue minDate:nil maxDate:nil style: RDatePickerStyleWheel didSelectDate:^(NSDate * _Nonnull date) {\n       \n    }];\n     \n**Option Picker**\n\n         NSArray *list = @[@\"Banana\", @\"Apple\", @\"Orange\"];\n         \n         [RPicker pickOptionWithTitle:@\"Select\" cancelText:@\"Cancel\" doneText:@\"Done\" dataArray:list selectedIndex:[NSNumber numberWithInt:2] didSelectValue:^(NSString * _Nonnull value, NSInteger index) {\n            \n         }];\n\n# Author   \n\n* [Raj Sharma](https://github.com/rheyansh)\n\n## Communication\n\n* If you **found a bug**, open an issue.\n* If you **want to contribute**, submit a pull request.\n\n# License\nRPicker is available under the MIT license. See the LICENSE file for more info.\n\n## Other Libraries\n\n* [RBiometric](https://github.com/rheyansh/RBiometric):- Elegant and Easy-to-Use library for iOS Biometric (TouchId and FaceId) authentication.\n* [RFirebaseMessaging](https://github.com/rheyansh/RFirebaseMessaging):- Project provides basic idea and approach for building small social media application using firebase and implementing chat using Firebase.\n* [RBeacon](https://github.com/rheyansh/RBeacon):- Sample project for turning android device into a Beacon device. App can work as both broadcaster and receiver.\n* [RPdfGenerator](https://github.com/rheyansh/RPdfGenerator):- A sample project to generate PDF file from data using itextpdf/itext7 library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frheyansh%2FRPicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frheyansh%2FRPicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frheyansh%2FRPicker/lists"}