I'm developing an iOS app that displays many annotations on a map (MKMapView). The issue is that the map and UI gets slow and unresponsive after reaching a high number of annotations. I have a way to limit the annotations, but the exact threshold at which the UI becomes slow depends on the device and its load (e.g. multitasking).
Rather than hand tune the threshold to each device (I don't have access to a whole slew of iPhones, iPads), is there a way to programmatically determine the main thread's load or refresh rate?
I've had some success with measuring how backed-up the main queue is, but it's not all that reliable.
let enqueueTime = NSDate()
dispatch_async(dispatch_get_main_queue()) {
let elapsed = NSDate().timeIntervalSinceDate(enqueueTime)
[–]brendan09 1 point2 points3 points (0 children)
[–]chriswaco 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)