cruffenach / CRToast

A modern iOS toast view that can fit your notification needs
MIT License
4.17k stars 463 forks source link

Fixed crash when snapshotting status bar #220

Closed sebyddd closed 7 years ago

sebyddd commented 7 years ago

screen shot 2017-02-27 at 16 52 13

As seen in the crash log above, CRToast isn't snapshotting the status bar on the main thread, which often crashes the app, especially when the thread is used.

This pull request, modifies the CRStatusBarSnapShotView method to perform the snapshot on the main thread.

sebyddd commented 7 years ago

I moved the async block to the parent caller. I am not yet familiar enough with 10.3 to say why this happens mostly there, but regardless, snapshotViewAfterScreenUpdates should be handled on the main thread.

Sure, take your time looking over it! :)