Post

Replies

Boosts

Views

Activity

Reply to Selection disappearing in NSTableView inside SwiftUI
I'm having the same issue. Have you had any luck solving it? I'm currently using a workaround: extension NSTableView {     func reloadDataSavingSelections() {         let selectedRows = selectedRowIndexes         reloadData()         selectRowIndexes(selectedRows, byExtendingSelection: false)     } } So I get a SwiftUI warning (Modifying state during view update, this will cause undefined behavior.) in exchange for the desired behavior. Which, for obvious reasons, is annoying and dangerous in the long term. The additional step of saving the select rows in the class and comparing the old selection with the new selection would probably even fix the SwiftUI warning but feels even more wrong...
Mar ’21