olddonkey/ODUIThreadGuard

I installed this via Cocoapods. Now what? When am I supposed to see warnings/errors about making UI changes outside the main thread?

Closed this issue · 6 comments

I installed this via Cocoapods. Now what? When am I supposed to see warnings/errors about making UI changes outside the main thread?

Right, if you have some UI change out of main thread, you will see assert, and from the left side memory stack menu, you can find which line you wrote cause this issue.

Just as the screenshot shown on the README

For some reason I am not seeing anything. I copied the example in the README pretty much word for word and ran my app but haven't seen anything appear.

DispatchQueue.global().async { self.whatWouldYouPayLabel.text = "test" }

Sorry, I forget CocoaPods will compile the Pods separately, then the right way to do is pull the ODUIThreadGuard.swift file into your project, any place.

Thanks for let me know, I will update README file.

I hate to say it, but I dragged the swift file into my project and ran again with the same code, but nothing is appearing. The text in the label is being changed so I know that line is being called.

Could you send me a project file to take a look? olddonkeyblog@gmail.com

It is weird.

The problem turned out to be that I had to change the word 'debug' to 'DEBUG'. Worked fine after that.