Eureka
Eureka copied to clipboard
Crash on macOS Catalyst while collapsing any InlineRow
Eureka v5.2.1 Xcode 11.4.1 macOS Catalina 10.15.4 MacBook Pro 13-inch, 2018
It's working fine on iOS, but it's crashing on macOS using Catalyst.
Out of bounds exceptions when trying to collapse any inline row (i.e. DateInlineRow, ...) Thread 1: Fatal error: Section: Index out of bounds
/Pods/Eureka/Source/Core/Section.swift, line 247

+1
@jurex Could you solve this issue or at least some kind of workaround?
nope, the only workaround I found for now is to not use any inline rows in catalyst.
Same problem on macOS Catalina 10.15.3
I found this works around it for now. This doesn't seem like the right solution but it works around this problem in a brute force type of way. Edit Core.swift:
open func rowsHaveBeenAdded(_ rows: [BaseRow], at indexes: [IndexPath]) {
guard animateTableView else { return }
// Picker InlineRow rows will crash on close with Eureka when running on the mac.
#if targetEnvironment(macCatalyst)
for row in rows {
if row is BaseInlineRowType || row is _DatePickerRow || row.baseCell is UIPickerViewDataSource {
tableView?.reloadData()
return
}
}
#endif
tableView?.beginUpdates()
tableView?.insertRows(at: indexes, with: insertAnimation(forRows: rows))
tableView?.endUpdates()
}
open func rowsHaveBeenRemoved(_ rows: [BaseRow], at indexes: [IndexPath]) {
guard animateTableView else { return }
// Picker InlineRow rows will crash on close with Eureka when running on the mac.
#if targetEnvironment(macCatalyst)
for row in rows {
if row is BaseInlineRowType || row is _DatePickerRow || row.baseCell is UIPickerViewDataSource {
tableView?.reloadData()
return
}
}
#endif
tableView?.beginUpdates()
tableView?.deleteRows(at: indexes, with: deleteAnimation(forRows: rows))
tableView?.endUpdates()
}
+1
+1
Does the workaround in #2103 work for you?