我有一个兴趣点列表。这些点是从Realm数据库加载的。每个点都应显示其到用户位置的距离。每次获得新位置时,我都会计算到所有点的距离。为了避免屏幕卡住,我在主线程的表格中显示列表后,在后台线程中进行数学运算。funcupdatedLocation(currentLocation:CLLocation){letqualityOfServiceClass=QOS_CLASS_BACKGROUNDletbackgroundQueue=dispatch_get_global_queue(qualityOfServiceClass,0)dispatch_async(backgroundQueue,