-
Notifications
You must be signed in to change notification settings - Fork 2
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
UIView.layer must be used from main thread only #14
Comments
Could you provide more information, such as situations when this error occurs, and also the console logs? |
This problem started to happen only in iOS 11. |
Hey, I'm sorry for bothering you with that, I've been trying to fix this issue, but no success so far. Could you find a solution for this? Best regards, |
It's probably related to how to download the tile? Make sure that after downloading the tile, you update the UI on the main thread. |
I'm adding this (mostly) for future readers. My current company is using this source, and we are getting occasional crashes just like the one above. However, that the tile draws on a background thread is expected: if you look at the original repository, there are links to various sites that explain CATileLayer behavior, including this by Apple: https://developer.apple.com/library/archive/qa/qa1637/_index.html Apple says that yes, they do the rendering on background threads, and a long time ago (pre ios4) UIKit was not background safe. However, they say that's fixed now. For me, the safest approach would be to modify the source to return a CGImage, not a UIImage, and draw it in the context. Its quite possible Apple missed some edge cases and that's what's causing the crashes. The rate at which we get them is very low, but they dribble in every week. Take a look at the Apple link above. |
Hi,
I've been using your library and it's been working really well, but lately I've tried to fix this warning without success, so I was wondering if you could find a solution for this bug.
Best regards,
Renan.
The text was updated successfully, but these errors were encountered: