22 questions
0
votes
2
answers
111
views
How to toggle DatePicker visibility with consistent alignment and spacing
I got a Button and DatePicker in a HStack. The button toggles the visibility of the picker. When the DatePicker is visible, the button label is set to .iconOnly. When the DatePicker is hidden, the ...
1
vote
2
answers
477
views
Why DatePicker not working with onTapGesture in SwiftUI
while building my app i encountered an issue that when i embed a DatePicker inside VStack and implement a onTapGesture on VStack then the DatePicker won't open calendar to pick dates on click.
VStack(...
0
votes
0
answers
91
views
SwiftUI Date keeps scrolling back to selected date
I am using SwiftUI Date Picker (iOS 16.2), however, after selecting a date, if try moving to select a different date, it keeps scrolling back to the date currently selected.
struct DatePickerExample: ...
1
vote
0
answers
218
views
DatePicker not updating the state when scrolling to 12 hours later/earlier
I am using SwiftUI DatePicker in my app. I have created a selectedTime state variable that is passed to the DatePicker. I am also using a Text component to display the selected time. As such, this ...
1
vote
1
answer
1k
views
Customization of Date Picker Issue in SwiftUI
I have added date picker in my application screen where need to designed using SwiftUI but not able to customize it at all, i want to set its leading, trailing and also want to add color in background ...
2
votes
1
answer
529
views
Why is the DatePicker not displaying in the confirmationDialog?
I'm trying to put a DatePicker() in a .confirmationDialog, but it's not displaying. My overall goal is to try and replicate the Journal app (in iOS 17.2 beta), so I need this look at least. I'm ...
1
vote
1
answer
226
views
How could I implement TabView page switching as a function of a selected date from DatePicker?
I've implemented the following code for my TabView and a DatePicker. I can currently slide between the three pages. And I can use the DatePicker to select between the 3 permitted days
import SwiftUI
...
1
vote
2
answers
540
views
Update SwiftUI Date Picker to match a model's computed property: Cannot assign to property
I have a form which lets the user create a project. In this form, I want to automatically change the project's deadline DatePicker based on the user's input such as start date, daily count, and target ...
0
votes
0
answers
108
views
SwiftUI DatePicker generating 200 line AutoLayout errors?
I'm getting 200 lines of AutoLayout errors in the console from SwiftUI's DatePicker. Looks like something to do with the label. In testing, this is happening in a blank project with nothing else in ...
1
vote
1
answer
473
views
SwiftUI: A list with a DatePicker and Text mangles the display
On iOS 15, if you display a List of VStacks with a Text and DatePicker as below
@main
struct WeirdListDatePickerProblem: App {
var body: some Scene {
WindowGroup {
ContentView()...
0
votes
1
answer
222
views
SwiftUI TimePicker Bindings to the view of the parent view
Hello, I would like to take some advice on my requirement. I have a parent view which has a child view and that has one more child view. Basically, I would like to pass the binded value to the parent ...
0
votes
0
answers
122
views
DatePicker with additional buttons to modify date - incorrect display format
I'm trying to create a View to allow me to tap a back arrow to go back a day, tap a forward arrow to go forward a day, and tap a date picker to select a specific date more quickly. The UI looks like ...
2
votes
0
answers
581
views
Why UIDatePicker is not showing the time and days in .inline style in iOS 15
Hi I have a UIDatePicker with inline style and dateAndTime mode as InputView to a UITextField, and when datePicker appears its not showing the days and the time. Please refer the image1(when it ...
0
votes
1
answer
1k
views
SwiftUI DatePicker not acting as expcted
I need to show two dates as showing in the screenshot fromDate & toDate. I'm getting some UI issue after selecting date from first component showing date on screen Jul 1, 2021 but after selecting ...
0
votes
1
answer
45
views
My UIDatePicker Is Not Coming Propper format
here is my code.
extension ProfileViewController {
private func openDatePicker() {
let datePicker = UIDatePicker()
datePicker.datePickerMode = .date
ageTextFieldOutlet....
3
votes
1
answer
1k
views
SwiftUI: Detected a case where constraints ambiguously suggest a height of zero for a table view cell's content view
How can I fix the reason why the warning appears?
struct ContentView: View {
@State private var selectedDate: Date = Date()
var body: some View {
Form {
DatePicker("...
1
vote
0
answers
1k
views
SwiftUI Datepicker changes format after selecting date
I've implemented a DatePicker with SwiftUI.
It works for the most part as is should, but when selecting a specific date, e.g 26. Nov 2019, it changes the format of the displayed date text.
Exampels:
...
0
votes
1
answer
2k
views
Swiftui DatePicker events
I have a DatePicker such as:
DatePicker("DATE & TIME", selection: Binding(get: {
self.dateTime
}, set: { newValue in
self.dateTime = newValue
if newValue > Date() {
...
0
votes
1
answer
2k
views
How to display only "day and month" from Date-input in SwiftUI
I have a form where the user should pick a date, and write a sum. It works fine, but when i display the information (form core data) in a List the whole date string is shown (time zone, time, year etc)...
1
vote
1
answer
79
views
minimumDate equivalent in swiftUI?
I have a DatePicker on my app and the user can't select a past date, because I'm creating a notification out of it
How can I implement a minimumDate equivalent in SwiftUI?
I tried creating an alert on ...
0
votes
2
answers
2k
views
Setting only specific months in UIDatePicker Swift 5
In my project i want to apply condition like, user can select date only 3months from current date.
I.e i want to display a date picker containing Month and Day with range of 90 days.
Eg. November is ...
6
votes
2
answers
2k
views
SwiftUI DatePicker in Form Dismisses When Keyboard Appears
I have a SwiftUI Form with a Section that contains a DatePicker. The DatePicker is set to have a datePickerStyle of CompactDatePickerStyle(), by default, since it's in a Form.
When tapping on the ...