Is there a way to parse iOS's log to a String at run time when it occurred? I need to parse a certain error log from UIKit and assert it at once when it appeared for debugging.
What we want to do is to parse the console for this error: This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes
. We've found and fixed the line that causes this error, but we need to prevent this for happening again. FYI, the culprit is a line that changes a constant of an Autolayout in a background thread. And unfortunately it is not recognized by the compiler as an error like when we do the same thing with UIButton or anything that is derived from UIView (which will give an error at compile time when we try putting it in a background thread).