IOS/Swift線程

Swift線程異步

1、異步線程async

    在異步線程中網上有一個模板spa

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
    //這裏是寫耗時線程
    dispatch_async(dispatch_get_main_queue(), {//返回到主線程
        //這裏回到了主線程
    })
})
相關文章
相關標籤/搜索