Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on macOS Catalyst while collapsing any InlineRow #2023

Open
jurex opened this issue Apr 22, 2020 · 7 comments
Open

Crash on macOS Catalyst while collapsing any InlineRow #2023

jurex opened this issue Apr 22, 2020 · 7 comments
Labels
catalyst macOS Catalyst issues

Comments

@jurex
Copy link

jurex commented Apr 22, 2020

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
Screenshot 2020-04-22 at 10 13 48

Screenshot 2020-04-22 at 10 09 49

@mats-claassen mats-claassen added the catalyst macOS Catalyst issues label Apr 22, 2020
@phr85
Copy link

phr85 commented Apr 30, 2020

+1

@phr85
Copy link

phr85 commented Apr 30, 2020

@jurex Could you solve this issue or at least some kind of workaround?

@jurex
Copy link
Author

jurex commented Apr 30, 2020

nope, the only workaround I found for now is to not use any inline rows in catalyst.

@Schlaubischlump
Copy link

Same problem on macOS Catalina 10.15.3

@gossmer
Copy link

gossmer commented May 29, 2020

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()
    }

@miajed
Copy link

miajed commented Jul 5, 2020

+1

+1

@mats-claassen
Copy link
Member

Does the workaround in #2103 work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
catalyst macOS Catalyst issues
Projects
None yet
Development

No branches or pull requests

6 participants