Post

Replies

Boosts

Views

Activity

Reply to How to declare a TableColumn with nullable field?
Is there a way to get a SwiftUI Table to be able to sort by a column of optionals? You can extend Optional for your specific case. For example, if you are trying to sort by an optional Int: extension Optional where Wrapped == Int { var sortOrder: Int { switch self { case let .some(wrapped): wrapped case .none: Int.max } } } Then your TableColumn would look like this: TableColumn("Count", value: \.count.sortOrder) { if let count = $0.count { Text(String(count)) } } If count is nil, it will be sorted as if its value is Int.max and the column will be blank for that row.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Reply to Updating Widgets from StaticConfiguration to IntentConfiguration Requires Re-Installation
If an app update causes a widget to switch from static to intent configuration, any currently running instances of the widget will only display the placeholder. If you tap and hold to Edit Widget, the configuration does not appear. Dragging out a new instance works fine. Oddly enough my pre-intent widget started working with my default configuration value after a few days 🤷🏻‍♂️ This would likely be because the widgets were relaunched. One quick way to do this is to restart the phone. There may be other ways, but I've found that a restart works. I've filed this with Feedback Assistant. FB8825588
Topic: App & System Services SubTopic: General Tags:
Oct ’20