Post

Replies

Boosts

Views

Activity

Reply to Selection disappearing in NSTableView inside SwiftUI
I ran into this too, but managed to find a solution. The updateNSView method. was getting called very frequently and so reloading the table which lost the section. I made this function check if its data had changed before reloading and that worked. I had passed the data to the Coordinator for use in the data source & delegate, so this code worked for me:   func updateNSView(_ nsView: NSTableView, context: Context) {     if tableData != context.coordinator.tableData {       context.coordinator.tableData = tableData       nsView.reloadData()     }   } The elements in my data array were already Equatable, so this works fine.
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’22
Reply to Piece of code in Playground that reliably crashes lldb server
I have the same problem. FB17182730 filed with sample playground and diagnostics file.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Selection disappearing in NSTableView inside SwiftUI
I ran into this too, but managed to find a solution. The updateNSView method. was getting called very frequently and so reloading the table which lost the section. I made this function check if its data had changed before reloading and that worked. I had passed the data to the Coordinator for use in the data source & delegate, so this code worked for me:   func updateNSView(_ nsView: NSTableView, context: Context) {     if tableData != context.coordinator.tableData {       context.coordinator.tableData = tableData       nsView.reloadData()     }   } The elements in my data array were already Equatable, so this works fine.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jul ’22