https://github.com/dan-codes1/textfielddatepicker
A SwiftUI package that provides a TextField with a DatePicker as its input view. The date picker replaces the keyboard as the input view for the TextField.
https://github.com/dan-codes1/textfielddatepicker
datefield dependency ios swift swiftpackage swiftui textfield uidatepicker uikit uitextfield
Last synced: about 1 month ago
JSON representation
A SwiftUI package that provides a TextField with a DatePicker as its input view. The date picker replaces the keyboard as the input view for the TextField.
- Host: GitHub
- URL: https://github.com/dan-codes1/textfielddatepicker
- Owner: dan-codes1
- License: mit
- Created: 2024-10-04T19:20:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-30T08:21:01.000Z (over 1 year ago)
- Last Synced: 2025-04-05T12:14:16.768Z (about 1 year ago)
- Topics: datefield, dependency, ios, swift, swiftpackage, swiftui, textfield, uidatepicker, uikit, uitextfield
- Language: Swift
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TextFieldDatePicker
A SwiftUI package that provides a TextField with a DatePicker as its input view. The date picker replaces the keyboard as the input view for the TextField.
https://github.com/user-attachments/assets/377e8821-fc07-42fb-846b-d5e611bcb073
## Requirements
- iOS 13.4+
- macOS 10.13+
- Swift 5.0+
## Installation
### Swift Package Manager
To add TextFieldDatePicker to your Xcode project:
1. In Xcode, open your project and select **File** > **Add Packages**.
2. Paste the repository URL: https://github.com/dan-codes1/TextFieldDatePicker.
3. Choose the package options and add it to your target.
## Usage
Here is a simple example:
```swift
struct ContentView: View {
@State private var date: Date?
var body: some View {
TextFieldDatePicker("Select date", date: $date)
}
}
```
## Contribution
Contributions are welcome! Please open an issue or submit a pull request if you would like to contribute to the project.
## See Also
[TextFieldPicker](https://github.com/dan-codes1/TextFieldPicker) is a similar package but for custom types. Check it out!