kaishin / Gifu

High-performance animated GIF support for iOS in Swift
Other
3.09k stars 279 forks source link

UIView animated being called from a background thread. Performing any operation from a background thread on UIView or a subclass is not supported and may result in unexpected and insidious behavior. #156

Closed MIOSY closed 4 years ago

MIOSY commented 4 years ago

@kaishin @maicki @nicktoumpelis @izqui @mbcharbonneau

I'm facing issue when i use GIF player in SceneKit please check below question for details->

https://stackoverflow.com/questions/60507447/playing-gif-using-gifu-library-in-scenekit-causes-app-ui-freeze-any-solution-ui

kaishin commented 4 years ago

Thanks for opening the issue. In the future, kindly refrain from mentioning random contributors when doing so.

If you can take the time to create and share a minimal case to reproduce the error I'd be happy to take a look.

MIOSY commented 4 years ago

HI @kaishin I'm doing ar app which detects images on top of it i'm playing video and gif. For gif implemention i used your library that's working fine to play gif and it causes one issue.

If you need some more details to reproduce issue i can provide you. please download this zip and run final project in ios device. if you scan image it plays dinosar video on top of it. In the same place ARSceneView delegate didAdd node for method replace Video code to GIF player(That you already know) it causes the issue. Let me if you need more details. Please help lot of people are facing smae issue it will be a great help. https://koenig-media.raywenderlich.com/uploads/2018/09/TriassicLoupe.zip

kaishin commented 4 years ago

Thanks for sharing this project. I will take a look.

MIOSY commented 4 years ago

Yes please run final project in device and scan image dinosaur video will popup. In place of video you need to replace code playing with GIF that can be done in ARSCeneView delegate didAdd node for method. After playing gif we can reproduce this app ui freeze issue.

Please let me know if anything is required i'm happy to provide any kind of details regarding this. Thank you.

MIOSY commented 4 years ago

HI Bro @kaishin

Just run this in Device. https://drive.google.com/file/d/1FKHPO6SkdOEZ-w_GFnrU5CeeeMQrNT-h/view?usp=sharing

You just run this project in device and scan dinosaur.png image(added ion xcode) you will gif playing on top of it. Once if you go back to firstVC that's all app is freezed you can't tap on any button in First VC and also hyou can't start AR scene again. I can't figure out this issue why it's happening after palying GIF can you pleach check and let me know.

If anything is required please let me know.. Thanks in advance.

MIOSY commented 4 years ago

HI @kaishin

Did you able to reproduce issue by running this project in device.??

kaishin commented 4 years ago

Yes, the project behaves the way you described.

kaishin commented 4 years ago

@MIOSY I conclude that this is not a bug in Gifu. First off, Gifu never calls setAnimationsEnabled directly. Second, since this issue happens when dismissing the VC, it's far more likely related to potential necessary cleanup in the parts managing your SceneKit node life cycle. I am not very familiar with that API so I will not be able to help.

I can reopen this issue if you have new information about how to reproduce this in an siolated environment–i.e. outside SceneKit, ARKit, etc.

In the meantime, please feel free to try other libraries for animating Gif images and see if they work for you.