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.
Example.mp4
- iOS 13.4+
- macOS 10.13+
- Swift 5.0+
To add TextFieldDatePicker to your Xcode project:
- In Xcode, open your project and select File > Add Packages.
- Paste the repository URL: https://github.com/dan-codes1/TextFieldDatePicker.
- Choose the package options and add it to your target.
Here is a simple example:
struct ContentView: View {
@State private var date: Date?
var body: some View {
TextFieldDatePicker("Select date", date: $date)
}
}
Contributions are welcome! Please open an issue or submit a pull request if you would like to contribute to the project.
TextFieldPicker is a similar package but for custom types. Check it out!