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

UI API called on a background thread #126

Open
ebeland opened this issue Jan 19, 2019 · 1 comment
Open

UI API called on a background thread #126

ebeland opened this issue Jan 19, 2019 · 1 comment

Comments

@ebeland
Copy link

ebeland commented Jan 19, 2019

I'm not sure if this error is unique to our apps use of collectionKit with multiple threads and Scenekit or an issue in the project, I don't have time to fully research it at the moment.

If someone with a more vanilla implementation is getting this error it is an issue.

"Main Thread Checker: UI API called on a background thread: -[UIScrollView setNeedsLayout]"

It occurs on line 83 of collectionView.Swift

public func setNeedsReload() {
needsReload = true
setNeedsLayout()
}

Easily fixed by going back to the main thread.

public func setNeedsReload() {
needsReload = true
DispatchQueue.main.async {
self.setNeedsLayout()
}
}

@casperzandbergenyaacomm
Copy link
Collaborator

I think the problem is that you called setNeedsReload() from a background thread.

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

No branches or pull requests

2 participants