GCD queue name to get / tag

How to get the current queue name? I mean the signature in the queue, for example com.example.myqueue. In Xcode 4, in the debugger, I see only _block_invoke_1. Thanks.

+5
source share
2 answers
+12
source

In Objective-C, you can write the label of the current queue with:

 NSLog(@"%s", dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)); 

In Swift (2.0):

 print(String(UTF8String: dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL))!) 
+8
source

Source: https://habr.com/ru/post/945406/


All Articles