{"id":24756723,"url":"https://github.com/jaydeep-godhani/swiftdatepicker","last_synced_at":"2026-02-10T05:31:52.817Z","repository":{"id":273310964,"uuid":"919282876","full_name":"jaydeep-godhani/SwiftDatePicker","owner":"jaydeep-godhani","description":"SwiftDatePicker is a custom reusable date picker component for iOS, featuring a sleek UI with rounded corners, delegate-based action handling, and easy integration into any project. It supports minimum date selection, formatted date outputs, and logical day identifiers like \"today\" or \"yesterday.\"","archived":false,"fork":false,"pushed_at":"2025-01-20T05:59:38.000Z","size":323,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T14:20:03.422Z","etag":null,"topics":["custom-date-picker","date","datepicker","ios","ios-development","swift","swift5","uidatepicker","xcode"],"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/jaydeep-godhani.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-20T05:29:08.000Z","updated_at":"2025-01-20T16:25:49.000Z","dependencies_parsed_at":"2025-01-20T06:30:28.799Z","dependency_job_id":"60ec6741-3382-418b-908a-4c24e32264a8","html_url":"https://github.com/jaydeep-godhani/SwiftDatePicker","commit_stats":null,"previous_names":["jaydeep-godhani/swiftdatepicker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydeep-godhani%2FSwiftDatePicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydeep-godhani%2FSwiftDatePicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydeep-godhani%2FSwiftDatePicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydeep-godhani%2FSwiftDatePicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydeep-godhani","download_url":"https://codeload.github.com/jaydeep-godhani/SwiftDatePicker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245070812,"owners_count":20556181,"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":["custom-date-picker","date","datepicker","ios","ios-development","swift","swift5","uidatepicker","xcode"],"created_at":"2025-01-28T14:20:07.872Z","updated_at":"2026-02-10T05:31:52.741Z","avatar_url":"https://github.com/jaydeep-godhani.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftDatePicker\n\n![GitHub repo size](https://img.shields.io/github/repo-size/jaydeep-godhani/SwiftDatePicker)\n![GitHub stars](https://img.shields.io/github/stars/jaydeep-godhani/SwiftDatePicker?style=social)\n![GitHub forks](https://img.shields.io/github/forks/jaydeep-godhani/SwiftDatePicker?style=social)\n\n**SwiftDatePicker** is a custom date picker implementation for iOS. It provides a visually appealing and reusable `DatePickerView` component that can be easily integrated into any iOS project. The date picker allows users to select a date, and its delegate methods enable handling actions like confirmation and cancellation.\n\n## Features\n\n- Customizable `UIDatePicker` with rounded background view.\n- Delegate methods to handle `OK` and `Cancel` button actions.\n- Dynamically adds and removes the date picker view.\n- Supports minimum date selection starting from today.\n- Provides formatted date strings and logical day identifiers (e.g., \"today\", \"yesterday\", \"tomorrow\").\n\n## Screenshots\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"Images/Screenshot - 1.png\" width=270\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"Images/Screenshot - 2.png\" width=270\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"Images/Screenshot - 3.png\" width=270\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Installation\n\nTo integrate **SwiftDatePicker** into your project:\n\n1. Clone the repository or download the source code.\n2. Copy the `DatePickerView.xib` and `DatePickerView.swift` files into your project.\n3. Link the `DatePickerView` class with the corresponding `.xib` file.\n\n## Usage\n\n### 1. Adding the Date Picker\n\nIn your `UIViewController`:\n\n```swift\n@IBAction func datePickerButtonAction(_ sender: UIButton) {\n    self.view.endEditing(true)\n    self.addDatePickerView()\n}\n\nfunc addDatePickerView() {\n    let datePickerView = DatePickerView(frame: self.view.bounds)\n    datePickerView.tag = 1001\n    datePickerView.delegate = self\n    datePickerView.datePicker.date = Date()\n    datePickerView.datePicker.minimumDate = Date()\n    self.view.addSubview(datePickerView)\n    self.view.bringSubviewToFront(datePickerView)\n}\n```\n\n### 2. Handling Delegate Methods\n\nConform to the `DatePickerViewDelegate` protocol to handle the button actions:\n\n```swift\nextension ViewController: DatePickerViewDelegate {\n    func datePickerOkButtonAction(view: DatePickerView, sender: UIButton, date: Date) {\n        // Handle selected date\n        print(\"Selected Date:\", date)\n        self.removeSubView()\n    }\n    \n    func datePickerCancelButtonAction(view: DatePickerView, sender: UIButton) {\n        // Handle cancellation\n        self.removeSubView()\n    }\n}\n```\n\n### 3. Removing the Date Picker View\n\n```swift\nfunc removeSubView() {\n    for subview in self.view.subviews {\n        if subview.tag == 1001 {\n            subview.removeFromSuperview()\n        }\n    }\n}\n```\n\n## Customization\n\nYou can easily modify the appearance of the `DatePickerView`:\n\n- Change the background color of `datePickerBackgroundView` for a different look.\n- Modify the corner radius for the `datePickerBackgroundView` in the `setDatePickerUI()` method.\n- Add more UI elements to the `DatePickerView.xib` file if needed.\n\n## Requirements\n\n- iOS 13.0+\n- Swift 5\n- Xcode 12 or higher\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the [`LICENSE`](LICENSE) file for details.\n\n## Author\n\nDeveloped by [Jaydeep Godhani](https://github.com/jaydeep-godhani). If you have any questions or feedback, feel free to reach out!\n\n## Acknowledgments\n\n- Thanks to the iOS community for their continuous support and inspiration!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydeep-godhani%2Fswiftdatepicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydeep-godhani%2Fswiftdatepicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydeep-godhani%2Fswiftdatepicker/lists"}