Sometimes it can be difficult to diagnose what is causing poor app performance and here’s a handy open source library from Wojtek Lukaszuk called Watchdog that allows you to log blocking on the main loop.
Watchdog allows you to specify an amount of time that the main thread needs to be blocked for then automatically generates a log statement if the thread is blocked for that amount of time.
This example from the readme shows how to use watchdog with a 0.2 second interval:
You can find Watchdog on Github here.
A nice library for finding out if the main thread is being blocked.
Original article: Open Source Swift Library For Easily Tracking Blocking Of The Main Thread
©2015 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.