Hello, everyone. I am having some troubles fixing up a UI in a mac app of mine, that just looks horrible for my liking, seeing as I was able to get closer to the interface I wanted with GTK than SwiftUI.
When I go looking through the docs, I see that I can get 2 of the three specific types of columns I need, which are as follows:
- 1 column where cells are date pickers
- 1 column with check boxes
- 1 column with a combo box
As this application is supposed to be a checkbook ledger app that can import data from QIF and JSON, and has been registered in a way that users can import data on iOS directly via Air Drop, there will be a column that cannot be edited, but all other fields are editable, with the combo box column allowing users to enter in a new category type or selecting an existing category.
However, my problem right now is when I go to implement either or the two easiest columns to think about, I cannot seem to access the value I need because the closure, which looks like this:
TableColumn("Date", value: \Record.event.date) { record in
DatePicker("", selection: $record.event.date, displayedComponents: [ .date])
}
Says that record is not found in scope, but seeing as the record variable is supposed to refer to RowValue, according to this and many of the other initializers for a column with dates, I should not be getting this error.
When I actually go about to supply a closure for the content argument, the autocompletion in XCode gives me an underscore, which makes it difficult to create a binding because I have no way to access the date.
How should I go about fixing this?
I got a reply to my query over on Discord regarding the subject of this thread, and it looks like what I want to do is not possible with SwiftUI at the moment, with the slight suggestion that checkboxes are, due to the video lesson shared here early.
The big hurdle in this is that Bindings are next to impossible in the given situation, which date pickers require, and likely more so with a ForEach in a lazy grid.
As such, I think I am going to mark this as solved, in spite of the situation likely not being fixable until the TableColumn API is refined or a real fix is implemented.