Search code examples
iosobjective-cpspdfkit

How to use PSPDFKit check use main thread code in background thread?


My application is slowly frequently.This UI is chaos.I am impossible.I want use PSPDFKit check use main thread code in background thread.Thanks!


Solution

  • Happy to share and help!

    We at PSPDFKit (An SDK to view and edit PDF documents) open source smaller parts of our SDK regularly and also share knowledge via our blog. You can find the main thread guard code here:

    https://gist.github.com/steipete/5664345

    I updated the gist to no longer require the PSPDFAssert macro. While this was explained in the comments, I see how this might be confusing if you just wanna be fast and copy the code without actually reading it :)